Hijri Date Converter Widget
Add a Hijri calendar converter to your site. Visitors turn a Gregorian date into its Umm al-Qura Islamic date, or a Hijri date into the Gregorian day, and see today's Hijri date - with a clear note that moon-sighting communities may differ by a day.
Live preview
Under the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/hijri-date-converter" title="Hijri Date Converter by A2Z Tools" width="100%" height="720" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="hijri-date-converter" data-height="720"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
Modern browsers ship the Unicode CLDR calendar data, which includes the Umm al-Qura calendar of Saudi Arabia under the identifier islamic-umalqura. The widget asks the browser to format a Gregorian date in that calendar, which gives the Hijri day, month and year with no table of our own to go stale. The reverse direction makes an arithmetic estimate from the Islamic epoch (16 July 622 Julian) and a mean month of 29.5306 days, then checks the days around it until the browser's own mapping matches, so both directions always agree. If the chosen month has only 29 days, asking for day 30 is refused with the month's real length. Umm al-Qura months start when, at Mecca on the 29th, conjunction has occurred before sunset and the Moon sets after the Sun; that astronomical rule does not depend on anyone sighting the crescent, so moon-sighting communities may start a month one day later. The supported range is 1356-1500 AH (14 March 1937 to 16 November 2077).
Method
- Gregorian to Hijri: Intl.DateTimeFormat('en-u-ca-islamic-umalqura') day, month and year at 12:00 UTC
- Hijri to Gregorian: estimate = epoch (16 July 622 Julian) + (year - 1) x 354.36667 + (month - 1) x 29.530589 + day - 1 days, then search +/- 25 days for the exact match
- Month length = start of next month - start of this month (29 or 30 days)
- Umm al-Qura month start (since 1423 AH): on the 29th, conjunction before sunset at Mecca and moonset after sunset, else the month has 30 days
Worked examples
Start of Ramadan 1446
Inputs: Gregorian 2025-03-01
Result: 1 Ramadan 1446 AH
Ramadan 1446 had 29 days in Umm al-Qura.
Eid al-Fitr 1447
Inputs: Hijri 1 Shawwal 1447
Result: Friday 20 March 2026
Ramadan 1447 began on 18 February 2026 and had 30 days.
Calculated Umm al-Qura dates for guidance. Religious observances that begin with a local moon sighting can fall a day earlier or later; follow your local mosque or authority.
Limitations
- Only the Umm al-Qura calendar; moon-sighting, Diyanet and MABIMS dates can differ by a day.
- Limited to 1356-1500 AH (1937-2077), the range of the published table the conversion was checked against.
- Needs a browser with the CLDR Umm al-Qura calendar; very old browsers show a message instead of a date.
Where publishers use it
- Mosque and Islamic centre websites showing the Hijri date beside event listings
- Gulf-region business sites where contracts and documents are dated in both calendars
- Hajj and Umrah travel agents converting departure dates for pilgrims
- Islamic school portals planning terms around Ramadan and the two Eids
- Genealogy and history blogs converting Hijri dates found on old documents
Questions
Which Hijri calendar does it use?
The Umm al-Qura calendar, Saudi Arabia's official civil calendar, also followed by several Gulf states and many mosques worldwide. Other calculation schemes (Diyanet in Turkey, MABIMS in South-East Asia) and moon-sighting calendars can differ by a day.
Why might my mosque's date be one day different?
Umm al-Qura starts a month by an astronomical rule at Mecca. Communities that wait to see the new crescent locally often begin the month a day later, especially in the Americas and Europe. Always follow your local authority for Ramadan and Eid.
Is 1 Ramadan 1446 really 1 March 2025?
Yes, in Umm al-Qura: 1 Ramadan 1446 AH = Saturday 1 March 2025, and that Ramadan had 29 days, so 1 Shawwal (Eid al-Fitr) was Sunday 30 March 2025. The widget's tests check these dates against a published reconstruction of the calendar.
When does the Hijri day start?
At sunset. The widget gives the Gregorian day on which the Hijri date is mostly observed; for religious use, the evening before already belongs to that Hijri date.
What if my browser cannot convert?
Very old browsers lack the Umm al-Qura calendar data. The widget then says so plainly instead of guessing; any current Chrome, Edge, Firefox or Safari works.
Sources
- Official Umm al-Qura calendar - Umm al-Qura calendar website, Saudi Arabia . The official site of the calendar the widget follows. Checked 2026-10-01.
- The Umm al-Qura Calendar of Saudi Arabia - R.H. van Gent, Utrecht University . Rules by period (calculated at KACST, current rule since 1423 AH) and a month-start table for 1356-1500 AH used to verify the test dates. Checked 2026-10-01.
- CLDR BCP 47 calendar identifiers (calendar.xml) - Unicode CLDR . Defines islamic-umalqura as "Hijri calendar, Umm al-Qura", the calendar the browser's Intl API exposes. Checked 2026-10-01.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Hijri Date Converter https://a2z.tools/embed/hijri-date-converter
<a href="https://a2z.tools/embed/hijri-date-converter">A2Z Tools Hijri Date Converter</a>
[A2Z Tools Hijri Date Converter](https://a2z.tools/embed/hijri-date-converter)
Hijri Date Converter by A2Z Tools - https://a2z.tools/embed/hijri-date-converter
Related widgets
-
Live countdown to the next Ramadan, then day N of Ramadan and the countdown to Eid al-Fitr.
-
Fajr, Sunrise, Dhuhr, Asr, Maghrib and Isha for any place, with the major calculation methods.
-
Today's Moon phase drawn to scale, with illumination, age and the next full and new moon.
-
A keyboard-friendly month calendar with today highlighted and your own marked dates.
-
Live days, hours, minutes and seconds to a date you set, with an "event has started" message.
-
Exact age in years, months and days, totals in months, weeks and days, and the next birthday.