What this calculator does
This tool converts a Western calendar date (Gregorian or Julian) into the Hijri, the Islamic lunar calendar. The Hijri calendar is a pure lunar calendar of twelve months that alternate between 30 days (full) and 29 days (hollow), with 11 leap years inserted in every 30-year cycle so that month beginnings stay close to the new moon. You can convert a single month or list every day across a span of up to one year.
How to use it
Choose whether your input date is Gregorian or Julian (this matters around the 1582 reform), enter the A.D. year, pick the starting month, choose how long a span to convert, and select the tabular Hijri variant (Standard, Kuwaiti, or Fatimid). The result shows the Hijri date of the first day plus a table of every day in the span with its weekday and converted Hijri date, written as a month abbreviation, day, and year AH.
The formula explained
Both calendars are bridged through the Julian Day Number (JDN), a continuous integer day count. The Western date is first turned into a JDN with the formula above.
$$\text{JDN} = D + \left\lfloor \frac{153m+2}{5} \right\rfloor + 365y + \left\lfloor \frac{y}{4} \right\rfloor - \left\lfloor \frac{y}{100} \right\rfloor + \left\lfloor \frac{y}{400} \right\rfloor - 32045$$$$\text{Hijri} = f\big(\text{JDN} - 1948440\big)$$The JDN is then mapped into the Islamic calendar using the closed-form tabular (Kuwaiti-algorithm) method: completed 30-year cycles of 10631 days are removed, the remaining days locate the year within the cycle, and further arithmetic yields the Hijri month and day. The weekday comes from JDN modulo 7.
Worked example
For September 11, 2001 (Gregorian): \(a = 0\), \(y = 6801\), \(m = 6\), giving \(\text{JDN} = 2{,}452{,}164\). Running the tabular conversion produces Jumada al-thani (month 6), day 22, year 1422 AH, on a Tuesday. So the answer is "Jum2 22, 1422 AH".
FAQ
Why might the date differ from my mosque's date? This is an arithmetic (tabular) calendar; real religious dates depend on physical moon sighting and can differ by about a day.
When does the Hijri day start? The Islamic day begins at sunset of the previous Gregorian evening, so a given Hijri date spans from the prior sunset to the named day's sunset.
What is the difference between the three variants? They differ only in which of the 30 cycle years receive an extra day appended to Dhu al-Hijjah, slightly shifting some conversions.