Desmarto
Guide · Knowledge Hub Reviewed July 20, 2026

How to Calculate Day of Year

The day of year (ordinal date) is the sequential day number counting from January 1 as day 1.

What Is Day of Year

The day of year (ordinal date) is the sequential day number counting from January 1 as day 1.

How It Is Calculated

Count the number of days between January 1 and the target date, then add 1. Our calculator does this instantly.

A practical method

The day of year is an ordinal number that counts January 1 as day 1. Each following date adds the lengths of the preceding months and the current day number. Dates after February need one extra day in a leap year, which is the main edge case in manual calculations.

  1. Check whether the year is a leap year: Years divisible by 4 are leap years, except century years unless they are also divisible by 400.
  2. Add completed months: Sum the number of days in every month before the target month.
  3. Add the current day: Because January 1 is day 1, add the calendar day number without subtracting one.
  4. Validate the range: The result must be 1–365 in a common year or 1–366 in a leap year.

Worked example

For March 1, 2028, add January's 31 days, February's 29 days, and 1 for March 1. The result is day 61. In 2027, February has 28 days, so March 1 is day 60.

Checks, edge cases, and common mistakes

  • Do not confuse day of year with day of month or ISO week number.
  • Remember that leap-year adjustment applies only to dates after February 28.
  • Some systems use zero-based ordinal days; verify whether January 1 is represented as 0 or 1.
  • Include the year whenever sharing an ordinal date because the leap-year status affects the result.

Try the Calculator

Get instant results with our free tool

D

Desmarto Editorial Team

The Desmarto team creates accurate, well-researched content about time, date, and work-hour calculations. Every guide is reviewed for precision and clarity.

Time CalculationsDate MathematicsWork HoursProductivity

Quick reference

Frequently asked questions

What is the day of year?

The day of year is the sequential day number from January 1 as day 1. December 31 is day 365 or 366.