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.