Gregorian to Hijri date converter
Enter a Gregorian date and get the tabular civil Hijri date for it, such as 24 Ramadan 1420 AH for 1 January 2000. The Kuwaiti arithmetic rules give the same answer on every device, with no moon-sighting tables. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2000-01-01
- Gregorian year
- 2,000
- Gregorian month
- 1
- Gregorian day
- 1
- Jdn
- 2,451,545
Converting a Gregorian civil date into an Islamic Hijri date is a daily need for scheduling, documentation, education, and product features that must show both calendars side by side. Religious holidays, fiscal labels, certificates, and localization strings often store one system and must display the other without relying on a browser clock or a remote astronomy service. This Gregorian to Hijri date converter accepts an explicit ISO calendar date in YYYY-MM-DD form, treats that day as a UTC civil date (no time-of-day and no local timezone shift), and returns the matching tabular civil Hijri year, month, and day using the well-known Kuwaiti arithmetic algorithm. The algorithm is fully deterministic integer math: Gregorian day to Julian Day Number, then JDN to Hijri on the fixed 30-year leap cycle. It is not moon-sighting; administrative and many software calendars use this civil convention, which can differ by a day from local religious observation.
What tabular civil Hijri means and how it differs from moon-sighting
The Islamic calendar is a pure lunar calendar of twelve months that alternate in a civil scheme between twenty-nine and thirty days, with an intercalary day added to the twelfth month in leap years of a thirty-year cycle. Eleven years in every thirty are leap years under the common arithmetic (tabular) convention, giving an average year length of three hundred fifty-four and eleven thirtieths days.
That arithmetic calendar is sometimes called the civil or tabular Hijri calendar because governments, databases, and many libraries use fixed rules instead of waiting for a local crescent sighting. Moon-sighting calendars used for religious observance in a given city can start a month one day earlier or later than the civil table; this capability deliberately documents the civil path so results stay reproducible across machines and years.
The conversion does not consult almanacs, satellites, or APIs: given the same ISO Gregorian input, every client receives the same Hijri year, month number, month name, and day. The civil epoch of the algorithm places 1 Muharram 1 AH on the proleptic Gregorian day that the Kuwaiti integers encode (classically tied to mid-July 622 CE in the Julian reckoning). When you publish dual-dated documents, pair this converter with a clear label such as tabular civil AH so readers know you are not claiming a fatwa-grade sighting date.
If your product must match a specific national religious authority, feed that authority's published mapping instead of treating any single arithmetic table as universal sacred truth.
Which date you enter and what you get
The value must be exactly four digits, a hyphen, two digits, a hyphen, and two digits: YYYY-MM-DD. The day must exist on the proleptic Gregorian calendar: month between 01 and 12, day within that month's length, and 29 February only in leap years. Years outside 0001–9999 are rejected.
Example: 2000-01-01 converts to 24 Ramadan 1420 AH under this civil table. Do not pass Date.now() unless you first format a fixed calendar day; the capability never reads the server clock.
What you can do with it
Dual-dated documents and certificates
Print Gregorian and tabular civil Hijri dates on diplomas, contracts, and official letters from a single stored ISO date string.
Localization and CMS date lines
Generate stable AH labels for articles, event pages, and email templates without client-side Date timezone surprises.
Classroom calendar comparisons
Let students verify arithmetic Hijri conversions against textbook tables and contrast civil vs moon-sighting conventions.
FAQ
Is this moon-sighting or civil tabular?
Tabular civil only (Kuwaiti arithmetic on a fixed 30-year leap cycle). Local religious sighting can differ by one day; label results as civil AH when that distinction matters.
Does timezone or the server clock affect the result?
No. The ISO date is treated as a whole UTC civil day with no time-of-day.
How many leap years does the tabular Hijri calendar have?
Eleven in every thirty years. In those leap years the twelfth month gets an extra day, and the thirty-year cycle always repeats the same way, so any date can be worked out without tables.
How many days are there in a Hijri month?
In the civil scheme the twelve lunar months alternate between 29 and 30 days. The only exception is the twelfth month of a leap year, which gains one extra day.
How should I label a document that shows both dates?
Add a clear label such as tabular civil AH, so readers know the date does not come from a crescent sighting. If you must match a national religious authority, use the dates that authority publishes instead.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/date/gregorian-to-hijri \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2000-01-01"}'const res = await fetch("https://api.kit.forhosting.com/date/gregorian-to-hijri", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2000-01-01"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/gregorian-to-hijri",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2000-01-01"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/gregorian-to-hijri", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2000-01-01"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2000-01-01"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/gregorian-to-hijri", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"date": "2000-01-01"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.gregorian_to_hijri",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The same pure module powers the free browser tool and the API path so homework checks, CMS plugins, and edge workers never disagree on the printed AH date for a given input.
Input contract, UTC day semantics, and response fields
POST a JSON body with one required string field named date (aliases iso_date, value, and gregorian are accepted). There is no time component and no timezone offset in the request: the string is interpreted as a whole UTC civil calendar day so two callers in different zones never split the same date string across midnight. On success the response echoes the normalized Gregorian date and its year, month, and day; includes the integer Julian Day Number used as the intermediate; and returns hijri_year, hijri_month (1–12), hijri_day, hijri_month_name in English, hijri_iso as year-month-day with zero-padded month and day, and hijri_formatted as a readable phrase such as 24 Ramadan 1420 AH. Metadata fields calendar, algorithm, and formula document that the path is hijri_tabular_civil via kuwaiti_arithmetic. Missing fields, non-strings, malformed ISO strings, and impossible calendar days fail with invalid_input and are not billed.
Where a Gregorian to Hijri API earns its keep
Product teams shipping bilingual date lines on tickets, diplomas, and government forms need a single function that turns a stored ISO date into a stable AH string without embedding large calendar libraries in every client. Education platforms teaching calendar systems can show the civil leap-year cycle next to Gregorian leap rules and let students check homework without scraping third-party sites that silently change algorithms. Localization pipelines that generate emails or PDFs in multiple locales can call this endpoint once per document date and cache the structured fields.
Technical questions
How do I convert a Gregorian date to Hijri?
Send {"date":"YYYY-MM-DD"} as a real Gregorian civil day. The API returns hijri_year, hijri_month, hijri_day, English month name, hijri_iso, and a formatted AH string using the tabular civil algorithm.
What input errors are rejected?
Missing date, non-string values, strings that are not exactly YYYY-MM-DD, years outside 0001–9999, and impossible days such as 2023-02-29 fail with invalid_input and are not billed.
What does the Gregorian to Hijri converter cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.