Islamic Date Calculator
Calculate days between two Hijri dates and convert Hijri dates to Gregorian. Uses the tabular Islamic calendar with leap year support.
Islamic Date Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: JD = floor((11Y+3)/30) + 354Y + 30M - floor((M-1)/2) + D + 1948440 - 385
Worked example — 162 days | 23 weeks 1 day | Approx 5.5 months
Formula
JD = floor((11Y+3)/30) + 354Y + 30M - floor((M-1)/2) + D + 1948440 - 385
This formula converts a Hijri date to a Julian Day Number (JD) using the tabular Islamic calendar. Y is the Hijri year, M is the month, and D is the day. The Julian Day Number can then be converted to Gregorian or used to compute date differences.
Worked Examples
Example 1: Days Between Two Hijri Dates
Problem:Calculate the days between 1 Muharram 1446 AH and 15 Jumada al-Thani 1446 AH.
Solution:1 Muharram 1446 = JD 2460493 (approx July 7, 2024) 15 Jumada al-Thani 1446 = JD 2460657 (approx Dec 18, 2024) Months: Muharram(30) + Safar(29) + Rabi I(30) + Rabi II(29) + Jumada I(30) + 14 days of Jumada II Days = 30 + 29 + 30 + 29 + 30 + 14 = 162 days Weeks = 23 weeks and 1 day
Result:162 days | 23 weeks 1 day | Approx 5.5 months
Example 2: Hijri to Gregorian Conversion
Problem:Convert 1 Ramadan 1447 AH to the Gregorian calendar.
Solution:Using the tabular Hijri-to-JD conversion: JD = floor((11 x 1447 + 3) / 30) + 354 x 1447 + 30 x 9 - floor(8/2) + 1 + 1948440 - 385 Convert JD to Gregorian date using standard algorithm. 1 Ramadan 1447 AH falls in February 2026.
Result:1 Ramadan 1447 AH = approximately February 2026 CE
Frequently Asked Questions
How does the Islamic (Hijri) calendar work?
The Islamic calendar, also known as the Hijri calendar, is a purely lunar calendar consisting of 12 months that alternate between 29 and 30 days. A standard Hijri year contains 354 days, which is about 11 days shorter than the Gregorian solar year. This means Islamic dates shift earlier relative to the Gregorian calendar by approximately 11 days each year. The calendar begins from the year of the Hijra, Prophet Muhammad's migration from Makkah to Madinah in 622 CE. Odd-numbered months have 30 days and even-numbered months have 29 days, except in leap years when the 12th month Dhul Hijjah has 30 days instead of 29.
What are leap years in the Hijri calendar?
The Hijri calendar uses a 30-year cycle containing 11 leap years. In a leap year, the last month Dhul Hijjah has 30 days instead of the usual 29, making the year 355 days instead of 354. The leap years occur at positions 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29 within each 30-year cycle. To determine if a Hijri year is a leap year, divide the year by 30 and check if the remainder matches one of these positions. For example, 1446 AH divided by 30 gives a remainder of 6, which is not in the list, so 1446 AH is a common year with 354 days.
How accurate is the tabular Islamic calendar for conversions?
The tabular Islamic calendar used in Islamic Date Calculator is an arithmetic approximation of the observational Islamic calendar. It can differ from the actual observed calendar by one to two days because the observational calendar depends on physical sighting of the crescent moon, which varies by geographic location and weather conditions. For historical dates and general planning, the tabular calendar is sufficiently accurate and widely used in astronomy and computing. Saudi Arabia and many Muslim-majority countries use the Umm al-Qura calendar for civil purposes, which may differ slightly from the tabular system used here.
Why do Islamic holidays shift dates every year in the Gregorian calendar?
Islamic holidays appear to move earlier by about 10 to 12 days each Gregorian year because the Hijri calendar year is approximately 354 days compared to the Gregorian year of 365 or 366 days. This difference of roughly 11 days means that Ramadan, Eid al-Fitr, Eid al-Adha, and other Islamic observances cycle through all seasons over a period of about 33 Gregorian years. This is by design in the Islamic tradition, as the lunar calendar ensures that religious duties like fasting during Ramadan are experienced in every season, making the obligation equitable across different climates and day lengths.
What are the twelve months of the Islamic calendar?
The twelve months of the Islamic calendar are Muharram, Safar, Rabi al-Awwal, Rabi al-Thani, Jumada al-Ula, Jumada al-Thani, Rajab, Shaban, Ramadan, Shawwal, Dhul Qadah, and Dhul Hijjah. Four of these are considered sacred months (Muharram, Rajab, Dhul Qadah, and Dhul Hijjah) during which warfare was traditionally prohibited. Ramadan is the month of fasting. Shawwal begins with Eid al-Fitr. Dhul Hijjah contains the Hajj pilgrimage period and concludes with Eid al-Adha. Each month begins with the sighting of the new crescent moon, though the tabular calendar uses mathematical rules for calculation.
When does an Islamic day actually begin?
At sunset, not at midnight. The Hijri day starts with maghrib on the preceding Gregorian evening, which is why the night of Laylat al-Qadr or the eve of Eid is already part of the new date. This shifts any calculation that mixes calendars: an event on Thursday evening after sunset carries Friday's Hijri date. The day-of-week labels shown here follow the standard convention of pairing a Hijri date with the Gregorian day it mostly overlaps, so treat evening events as belonging to the following Hijri day.
Why is finding the gap between two Hijri dates harder than between two Gregorian ones?
Because Hijri month lengths alternate 30 and 29 days and the twelfth month changes length in leap years, there is no constant number of days per month or per year to subtract with. Converting both endpoints to a Julian Day Number sidesteps the problem entirely: the JDN is a plain running count of days, so the difference is a single subtraction that automatically accounts for every 29-day month and every leap year in between. That is exactly what Islamic Date Calculator does before reporting days, weeks and remainder.
Why is the day count exact but the month figure only approximate?
The day count comes from subtracting two Julian Day Numbers, so it is exact by construction. The month figure divides that gap by 29.53, the mean synodic month, and rounds. Real calendar months are whole numbers of days — 29 or 30 — so a span of, say, 162 days is not a clean multiple of any month length and can only be described as roughly five and a half months. Use the day count for anything that must be precise, such as an iddah, a contract term, or a hawl.
How do I express an age or a holding period in lunar years?
Divide the exact day count by about 354.37, the average length of a tabular Hijri year across its 30-year cycle. Because that is roughly eleven days short of a solar year, lunar ages run about 3% higher than Gregorian ones: a span of 32 solar years is close to 33 lunar years. This matters wherever Islamic law counts in lunar terms — the zakat hawl, the age at which obligations begin, or a waiting period — and it is why a Hijri anniversary drifts steadily earlier through the Gregorian year.
Why do two tabular converters sometimes disagree by exactly one day?
Usually because they anchor to different epochs. 1 Muharram 1 AH is placed by some implementations on 16 July 622 CE, the so-called civil epoch, and by others on 15 July 622 CE, the astronomical epoch, producing a constant one-day offset across every converted date. A second source of variation is the leap-year set, since a few tabular variants shift which years of the 30-year cycle carry the extra day. Neither offset is an error; check which convention a source uses before reconciling two results.
References
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮Hijri Date Converter
Calculate hijri date converter with inputs, formulas, and instant results.
🧮Islamic Months Calculator
Convert between Hijri month names, numbers, and corresponding Gregorian date ranges.
🧮Ramadan Fasting Hours Calculator
Calculate fasting hours from dawn to sunset for any location and date during Ramadan.
🧮Islamic Mortgage Calculator — Murabaha & Ijara
Calculate islamic mortgage with inputs, formulas, and instant results.
🧮Islamic Inheritance Calculator
Calculate islamic inheritance with inputs, formulas, and instant results.
🧮Islamic Will Calculator
Calculate Islamic inheritance shares (faraid) for all heirs according to Quran and Sunnah.
🧮Zakat Calculator
Calculate zakat with inputs, formulas, and instant results.
🧮Zakat Al Fitr Calculator
Calculate zakat al fitr with inputs, formulas, and instant results.