Dates & Time

Day of the Year (Ordinal Date)

Enter a date and it returns its ordinal day number, where January 1 is day 1 and December 31 is 365 or 366. It also shows days remaining, the ISO week number, and leap-year status.

Reviewed and updated

How to use
  1. Enter any date.
  2. Check days remaining in the year, the ISO week, and whether it is a leap year.
Jump to
Day of the year

Days remaining
ISO week
Days in year
ISO ordinal
Date math uses your inputs as given; check time-zone and leap-year edge cases.
Was this helpful?

Sum the whole months, then add the day

day‑of‑year = Σ days in earlier months + day of month

The ordinal day number is where a date falls inside its year, from 1 up to 365 (or 366 in a leap year). To find it, add the lengths of every complete month before yours, then add the day of the month.

Cumulative days to the end of each month

Add the day of the month to the previous month's cumulative total. The leap column applies from March onward.

MonthDaysCumulativeCumulative (leap)
January313131
February28 / 295960
March319091
April30120121
May31151152
June30181182
July31212213
August31243244
September30273274
October31304305
November30334335
December31365366

Days remaining in the year is just 365 (or 366) minus the day number.

The leap-year rule that trips people up

  • The full rule. A year is a leap year if it divides by 4, except century years, which must also divide by 400. So 2000 was a leap year but 1900 and 2100 are not.
  • Where it bites. The extra day is February 29, so only dates from March onward shift by one. January and February day numbers are identical in leap and normal years.
  • ISO ordinal format. Written YYYY-DDD with the day zero-padded to three digits, so the 100th day is written as -100.

Common questions

What is an ordinal day number?

It is the position of a date within its year, counted from 1 on January 1. It runs to 365 in a normal year and 366 in a leap year. It is also called the day of the year.

How do I work out the day number without a tool?

Add up the days in every whole month before the current one, then add the day of the month. In a leap year, add one more for any date from March onward.

Is the ordinal day the same as a Julian day number?

No. The ordinal day resets to 1 each January. A Julian day number is a continuous count that astronomers run from 4713 BC without ever resetting.

From the blog

Guides & how-tos

All articles →