Day of the Year Calculator

Enter any date to find its ordinal position in the year — the day number (1-366), days remaining, and percent of the year completed, using the Gregorian calendar's leap-year rule.

Quick Facts

Method
Cumulative day count from January 1
Day of year = day of month + total days in every full prior month.
Leap year rule
Divisible by 4, except centuries not divisible by 400
Leap years have 366 days; February has 29 instead of 28.

Your Results

Calculated
Day of the year
-
Ordinal day number (1-366)
Days remaining
-
Days left in the year
Year progress
-
Percent of the year elapsed
Year type
-
Leap year or common year

Ready

Choose a month, day, and year, then press Calculate.

About the Day of the Year Calculator

The "day of the year" (also called the ordinal date or day-of-year number) is a running count of days from the start of the year. January 1 is day 1, January 2 is day 2, and the count continues through December 31, which is day 365 in a common year or day 366 in a leap year. This calculator converts any calendar date into that ordinal number and also reports how many days remain in the year and what fraction of the year has elapsed.

The formula

For a date with month M, day D, and year Y, the day of the year is:

  • Day of year = D + (sum of days in every full month before M), using the standard month lengths (31, 28 or 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 for January through December).
  • Days remaining = (365 or 366) − day of year, depending on whether Y is a leap year.
  • Percent elapsed = day of year ÷ (365 or 366) × 100.

The leap-year rule

This calculator uses the standard Gregorian leap-year rule: a year is a leap year if it is divisible by 4, unless it is also divisible by 100 — in which case it must also be divisible by 400 to remain a leap year. That means 2024 and 2028 are leap years, 1900 was not (divisible by 100 but not 400), and 2000 was (divisible by 400). Leap years add one extra day, February 29, which shifts the day-of-year number for every date from March 1 onward by one compared to a common year.

Worked example

For July 17 in 2026 (a common year): January through June contribute 31+28+31+30+31+30 = 181 days, so July 17 is day 181 + 17 = 198. With 365 days in 2026, that leaves 365 − 198 = 167 days remaining, and the year is 198 ÷ 365 ≈ 54.2% complete.

Common uses

  • Programming and data formats that store dates as an ordinal "DDD" (day-of-year) value, such as the Julian date field used in some file and log formats.
  • Tracking progress through the year for goals, budgets, or academic terms measured in days.
  • Comparing two dates in different years by their position in the year rather than their exact calendar date.
  • Manufacturing and inventory date codes that print a 3-digit day-of-year number instead of a month and day.

Frequently Asked Questions

How is the day of the year calculated?
The day of the year is a running count of days from January 1 (day 1) through the chosen date. It equals the day-of-month plus the total number of days in every full month before it in that year. December 31 is day 365 in a common year and day 366 in a leap year.
What years are leap years?
Under the Gregorian calendar, a year is a leap year if it is divisible by 4, except that century years (divisible by 100) are leap years only if also divisible by 400. So 2024 and 2028 are leap years, 1900 was not, but 2000 was.
Why does February matter for this calculation?
February is the only month whose length changes from year to year — 28 days in a common year, 29 in a leap year. That single extra day shifts the day-of-year number for every date from March 1 onward in a leap year.
Is day 1 January 1st or January 0th?
Day 1 is January 1st. The count is 1-indexed, so January 1 is day 1, January 31 is day 31, February 1 is day 32, and so on through day 365 or 366 on December 31.