ISO ordinal date converter
15 March 2024 is day 75 of the year, written 2024-075 in ISO ordinal form. Convert any calendar date into its day-of-year number and back, with leap years handled for you. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2024-03-15
- Year
- 2,024
- Month
- 3
- Day
- 15
- Day of year
- 75
ISO 8601 defines two civil date forms that share the same year but express the day differently: the familiar calendar triple year-month-day, and the ordinal form year plus day-of-year from one through three hundred sixty-five or three hundred sixty-six.
Calendar form, ordinal form, and when each direction applies
An ISO calendar date is written as four-digit year, two-digit month, and two-digit day separated by hyphens, for example two thousand twenty-four dash zero three dash one five for the fifteenth of March. An ISO ordinal date uses the same year, a hyphen, and a three-digit day-of-year running from zero zero one on the first of January through three hundred sixty-five in a common year or three hundred sixty-six in a Gregorian leap year.
Convert calendar to ordinal when you need a compact day index for a year, sequential file names, or analytics that treat each day as an integer axis. Convert ordinal to calendar when a feed only ships day-of-year and your UI, invoice, or validator expects month and day.
Leap years, year length, and invalid day-of-year errors
Under the Gregorian rules a year is a leap year when it is divisible by four, except that century years must also be divisible by four hundred. Leap years have three hundred sixty-six days and a twenty-nine-day February; common years have three hundred sixty-five days and a twenty-eight-day February. That is why two thousand is a leap year, nineteen hundred is not, and two thousand twenty-four is a leap year while two thousand twenty-three is not.
Calendar inputs with an impossible day for the month, such as the thirty-first of April or the twenty-ninth of February in a non-leap year, are likewise rejected.
What you can do with it
Logistics and batch file naming
Warehouses and batch jobs name files with YYYY-DDD sequences and need a reliable bridge to human-readable YYYY-MM-DD labels in UIs and invoices.
Validation of ordinal feeds
Integrations that receive day-of-year from partners reject overflow values such as day 366 in a non-leap year before they enter billing or scheduling systems.
FAQ
What happens if the ordinal day exceeds the year length?
For example day 366 in a non-leap year, or any day above 366, is rejected and is not charged.
Is the ISO ordinal date converter free?
The browser tool runs free on your device.
What is the ordinal date of 15 March 2024?
It is 2024-075, because 15 March is the 75th day of 2024. The year comes first, then a three-digit day count that starts at 001 on 1 January.
Why does a leap year change the day number after February?
A leap year adds February 29, so every date from 1 March onward gets a number one higher than in a common year. That is also why the count ends at 366 instead of 365.
Can I turn a day-of-year number back into a normal date?
Yes. Enter the year and the day number, such as 2024-075, and you get the month and day, here 15 March 2024. A number larger than the length of that year is refused.
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/ordinal-date \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2024-03-15","calendar":"valor-ejemplo"}'const res = await fetch("https://api.kit.forhosting.com/date/ordinal-date", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-03-15",
"calendar": "valor-ejemplo"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/ordinal-date",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2024-03-15",
"calendar": "valor-ejemplo"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/ordinal-date", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2024-03-15","calendar":"valor-ejemplo"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2024-03-15","calendar":"valor-ejemplo"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/ordinal-date", 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": "2024-03-15",
"calendar": "valor-ejemplo"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.ordinal_date",
"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
This ISO ordinal date converter maps YYYY-MM-DD to YYYY-DDD and the reverse direction with deterministic Gregorian leap arithmetic, rejects day-of-year values that exceed the true length of the year, and returns both representations plus structured fields in a single JSON payload.
Calendar form, ordinal form, and when each direction applies
Send either a date string, an ordinal string, year plus month plus day, or year plus day_of_year; aliases such as calendar_date, ordinal_date, doy, and ddd are accepted when documented. Do not mix opposing modes in one request—the engine rejects ambiguous payloads with invalid_input so callers fix the body instead of guessing which field wins. Identical inputs always yield identical JSON because the path never reads the wall clock, locale, or network.
Leap years, year length, and invalid day-of-year errors
When converting ordinal to calendar, any day-of-year less than one or greater than the year length fails with invalid_input and a message that states the actual days in that year—for example day three hundred sixty-six in two thousand twenty-three exceeds year length. The response echoes is_leap_year and days_in_year so dashboards can show year facts without a second call.
API usage, pricing, workflows, and practical limits
Call the free in-browser ISO ordinal date converter for homework checks, data-entry demos, and quick verification without installing calendar libraries. Year bounds follow the published parameter range for isolate safety and common civil ISO tooling. Send a JSON body with one clear mode: date as YYYY-MM-DD, ordinal as YYYY-DDD, structured year month day, or structured year and day_of_year. On success the payload includes calendar_date, ordinal_date, the numeric components, direction equal to to_ordinal or to_calendar, calendar equal to gregorian, and method equal to iso_ordinal_date for routers and tests that branch on labels. Use the prepaid API when a logistics platform, scientific pipeline, compliance archive, or SDK needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with days-in-month tools when you only need February length, or with formatters when the next step is localized display of an already-normalized calendar date.
Integration use cases
Scientific and sensor day indexes
Research pipelines store samples as year plus day-of-year; convert to calendar dates for reports and back to ordinal form for compact archives without host Date drift.
Technical questions
How do I convert YYYY-MM-DD to an ISO ordinal date?
Send JSON with date set to a calendar string such as 2024-03-15, or send year, month, and day. The response includes ordinal_date as YYYY-DDD and day_of_year as an integer.
How do I convert YYYY-DDD back to a calendar date?
Send ordinal as 2024-075, or send year plus day_of_year. The response returns calendar_date as YYYY-MM-DD with month and day filled in.
Does this use JavaScript Date or time zones?
No. Conversion uses pure Gregorian leap-year arithmetic and cumulative month lengths, so results are identical across environments and safe for golden tests.