Ordinal Date Converter

Convert between calendar dates and ISO ordinal dates (YYYY-DDD)

Ad placeholder (leaderboard)

Convert any calendar date into its ISO 8601 ordinal date — the year plus the day-of-year (001–366) — or convert an ordinal date back to a normal calendar date. Ordinal dates are common in scientific data, aviation, and mainframe systems where the day number within the year matters more than the month.

How it works

An ordinal date is written YYYY-DDD. The DDD part is the day-of-year: January 1 is day 1, and December 31 is day 365 in a common year or day 366 in a leap year.

To find the day-of-year, the tool adds up the lengths of every month before the target month, then adds the day-of-month:

dayOfYear = sum(daysInMonth[0..month-1]) + day

February counts as 29 days when the year is a leap year. The Gregorian leap-year test is:

isLeap = (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)

To convert back, the tool walks forward month by month, subtracting each month’s length from the day-of-year until the remainder fits inside a month — that remainder is the day, and the month it stopped on is the calendar month.

Example

The 60th day of 2026:

  • 2026 is not a leap year (2026 % 4 ≠ 0).
  • January has 31 days, leaving 60 − 31 = 29.
  • February (28 days in 2026) covers up to day 59, so 29 lands on March.
  • 29 − 28 = 1 → March 1, 2026, i.e. 2026-060.

In a leap year such as 2024, the same day-of-year 60 would fall on February 29 instead, because February holds an extra day.

Notes

The valid range for the day-of-year is 1–365 in common years and 1–366 in leap years; entering a larger number is rejected. Everything runs locally in your browser — no dates are uploaded.

Ad placeholder (rectangle)