Day of Year Calculator

Enter a date as YYYY-MM-DD to find its day-of-year number.

How it is calculated

Pick a date in the date field, which sends it as YYYY-MM-DD whatever display format your browser uses. The tool adds up the days in all earlier months of that year and then adds the day of the month: day of year = (days in months before) + day. Whether February has 28 or 29 days depends on the leap-year test, divisible by 4, except centuries unless divisible by 400, so 2000 and 2024 are leap years while 1900 and 2023 are not. The year has 365 or 366 days, and days remaining = total days in the year − day of year, so December 31 always shows 0 days remaining. In a link, a month or day with one digit, such as 2024-2-5, is accepted, while a date that does not exist (2023-02-29, month 13) or any other layout, like 03/01/2024, returns no result. The tool applies the Gregorian calendar to every year.

Worked example

Take March 1, 2024, picked in the date field and sent as 2024-03-01. 2024 is divisible by 4 and not a century year, so it is a leap year with 366 days. Days before March: January 31 + February 29 = 60. Add the day of the month, 1, to get day 61. Days remaining: 366 − 61 = 305 days. The tool shows 61, 305 days, and leap year: Yes. For comparison, March 1, 2023, is day 60, because February 2023 has only 28 days, and it also has 305 days remaining, since 2023 has 365 days.

Try this example →

Common mistakes

  • Mixing up day and month in the date field, whose display order follows your browser (03/04 can be March 4 or April 3); check the field shows the intended day before reading the result.
  • Forgetting the leap day. After February 28, the same calendar date is one day number higher in a leap year, so March 1 is day 61 in 2024 but day 60 in 2023.
  • Treating every year divisible by 100 as a leap year, or every year divisible by 4. 1900 is not a leap year; 2000 is, because it is divisible by 400.
  • Expecting the day-of-year to count the date itself as zero. January 1 is day 1, so the remaining days on December 31 are 0, not 1.
  • Confusing this ordinal number with the astronomical Julian Date or a week number; they count different things.

About this calculator

The day-of-year (also called ordinal date or Julian day-of-year, not to be confused with the astronomical Julian Date) numbers every calendar date from 1 on January 1st up to 365 on December 31st in a common year, or 366 in a leap year — one determined by the standard Gregorian rule (divisible by 4, except century years unless divisible by 400).

This ordinal form is formalized in ISO 8601 as the YYYY-DDD date format, and it is widely used in programming, manufacturing date codes, agriculture and climate data, and payroll or scheduling systems where counting elapsed days within a year is more convenient than working with month and day separately.

Was this helpful?

You can pick up to 3 reactions.

Note from the editors

The days remaining figure counts the days after the chosen date, not including it. For June 21, 2026, the tool gives day 172 and 193 days remaining, so if today also counts, you have 194 calendar days left in the year. Add one whenever you plan inclusively. Do you use the day number for date codes such as YYDDD on labels, or for scheduling?

Comments

  • Be the first to comment.

Popular calculators

All Calculators