Hijri year length calculator
This Hijri year length calculator identifies whether a year in the tabular Islamic calendar contains 354 or 355 days.
Run — free
Enter a positive Hijri year number and receive its position in the repeating 30-year cycle, its leap-year status, and its exact day count. The result comes from a fixed arithmetic calendar rule, so it is deterministic and independent of location, moon sightings, time zones, current time, or external services. It is designed for software, historical calculations, test fixtures, and educational work that explicitly uses the tabular calendar rather than an observational calendar.
What this calculator means by a Hijri year
The Islamic calendar is lunar, but not every implementation decides month boundaries in the same way. This calculator uses the tabular Islamic calendar, an arithmetic model with a repeating cycle of thirty years. Ordinary years contain 354 days, while designated leap years contain 355 days because the final month receives an additional day. That definition matters: a calendar based on local crescent observations, an official announcement, or an astronomical visibility model can assign a different civil date near a month boundary. Enter the Hijri year as a positive whole number, such as 1446. The response reports the original year, its position from 1 through 30 in the cycle, whether that position is a leap position, and the resulting number of days. Use this capability when your specification names the tabular or arithmetic Islamic calendar, or when you need stable fixtures that must produce the same answer on every machine. Do not treat its result as a ruling about the start of a religious observance in a particular community.
How the 354-or-355-day result is computed
The calculation first maps the supplied year into one of the thirty positions in the tabular cycle. Positions 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29 are leap years; every other position is a common year. A leap position produces 355 days, and a common position produces 354 days. This is exact integer arithmetic, not an estimate of the lunar phase. The implementation does not call the JavaScript Date object, read the system clock, make a network request, or depend on a time-zone database. Consequently, UTC and local settings cannot change the answer. The input must be a numeric, positive, safe integer: decimal strings, fractions, zero, negative years, infinities, and unsafe integers are rejected rather than silently coerced. The cycle position is included in the output so callers can audit the decision instead of accepting an unexplained boolean. This transparent rule also makes the endpoint convenient for unit tests, migrations, and cross-language compatibility checks.
Choosing the right calendar model for your task
Use this result for systems that deliberately adopt a conventional tabular chronology: date-conversion libraries configured for the arithmetic Islamic calendar, recurring schedule simulations, classroom demonstrations, database validation, and historical calculations where deterministic reproducibility is more important than reconstructing a sighting. If you are integrating records from another system, confirm its calendar variant before comparing year lengths. Labels such as Hijri, Islamic, civil, tabular, Umm al-Qura, and observational are not always interchangeable. An official national calendar may be published from astronomical criteria and can diverge from the fixed cycle. This endpoint answers only the narrow question encoded in its name: how many days the given tabular Hijri year has. It does not convert a date, predict crescent visibility, identify holidays, or declare when a month begins in any jurisdiction. Via the API, each request costs $0.002. Because the response is small and deterministic, you can safely cache it by year, although the direct calculation is already constant-time and has no external dependency.
What you can do with it
Validate calendar data
Check that stored day counts agree with the arithmetic Hijri calendar before importing or publishing a dataset.
Build deterministic tests
Generate stable expected values for software that implements the same 30-year tabular Islamic cycle.
Explain leap-year structure
Show students a cycle position, leap status, and year length without relying on a current calendar service.
FAQ
Does every Islamic calendar use this result?
No. This calculator is specifically for the tabular Islamic calendar. Observational and official calendars can use different rules.
Which cycle years are leap years?
Positions 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29 of each 30-year cycle are leap years.
Why does a leap Hijri year have 355 days?
The tabular system adds one day to the final month in its designated leap years, increasing the total from 354 to 355.
Does the result depend on UTC or my time zone?
No. It uses only fixed integer arithmetic and never reads a clock, Date object, time zone, or external service.
What does an API request cost?
Each API request costs $0.002.
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/hijri-year-length \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"year":1446}'const res = await fetch("https://api.kit.forhosting.com/date/hijri-year-length", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"year": 1446
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/hijri-year-length",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"year": 1446
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/hijri-year-length", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"year":1446}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"year":1446}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/hijri-year-length", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"year": 1446
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.hijri_year_length",
"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. |