Day of the Year Calculator

Day of the year calculator: enter a date and get the ordinal day number (Jan 1 = 1, Dec 31 = 365 or 366), the number of days remaining in the year, the ISO 8601 week number, and the leap-year status.

Time & Date 2.9K/mo searches ISO 8601 Leap-year aware
Rate this calculator · 5.0 (1)

Day of the Year Calculator

Ordinal date, days remaining, ISO 8601 week number

Instructions — Day of the Year Calculator

Pick a date with the picker (or type one in YYYY-MM-DD). The calculator immediately returns the ordinal day number — January 1 is day 1, January 31 is day 31, December 31 is day 365 in a common year and day 366 in a leap year. It also shows how many days remain in the year, the ISO 8601 week number, the ISO ordinal form (such as 2026-100 for April 10, 2026), and whether the year is a leap year.

Worked example. March 15, 2026 is day 74 of 365. The ISO ordinal form is 2026-074. The ISO week is W11 (the week starting Monday, March 9). 2026 is not a leap year, so 291 days remain after March 15.

Formulas

Add the days in each completed month before the target month, then add the day of the month:

$$\text{DayOfYear} = \sum_{i=1}^{M-1} \text{days}(i) + D$$

The Gregorian leap-year rule, from the US Naval Observatory:

$$\text{Leap} = (Y \bmod 4 = 0) \land \big((Y \bmod 100 \neq 0) \lor (Y \bmod 400 = 0)\big)$$

Days remaining in the year:

$$\text{Remaining} = T - \text{DayOfYear}, \quad T = 366 \text{ if leap, else } 365$$

Reference

The ordinal date is defined in ISO 8601 as YYYY-DDD with a three-digit day-of-year (so February 1 is 2026-032). It is not the same as the astronomical Julian Day Number, a continuous count of days since 4713 BC used for astronomical calculations.

ISO 8601 weeks start on Monday and run Monday-Sunday. Week 1 is the week containing the first Thursday of January, which means Jan 1 can fall in week 52 or 53 of the previous ISO year. Years that begin on a Thursday (or on Wednesday in a leap year) have 53 ISO weeks; all others have 52.

Article — Day of the Year Calculator

Day of the year calculator

The day of the year, also called the ordinal date, is the position of a date inside its year, counted from 1. January 1 is day 1; December 31 is day 365 in a common year and day 366 in a leap year. March 1 sits at day 60 in 2025 and day 61 in 2024.

The format is defined by ISO 8601 as YYYY-DDD, a four-digit year and a three-digit day-of-year padded with leading zeros. April 10, 2026 is 2026-100. The format is used by some logging systems, by NASA mission timekeeping, and by anyone who has to sort or filter date strings without parsing them.

What the day of the year is

An ordinal date answers one question: which numbered day of this year is it? The arithmetic is the cumulative count of days from January 1 to the date in question, inclusive of January 1. The day of the year is sometimes called the Julian day in software documentation, but that term properly refers to a separate astronomical count starting in 4713 BC. To avoid confusion, the formal name is ordinal date.

Common applications are project planning (day 73 of the fiscal year), agricultural growing-degree-day models, satellite housekeeping logs, and the 030 / 060 / 090 milestones that some accounting systems still print on invoices.

The day of the year formula

For a date in month M and day-of-month D, the day of the year is the sum of the days in every completed month plus D. In a common year, that means add 31 for completed January, 28 for February, 31 for March, and so on, then add the day-of-month. In a leap year, February contributes 29 instead of 28, which shifts every March-through-December date forward by one.

Day-of-year shorthand
DayOfYear = Σ days(month) + D
Common year = 365 days
Leap year = 366 days
Remaining = Total − DayOfYear

Leap year and day of the year

The Gregorian leap-year rule has three parts, in the order they apply: years divisible by 4 are leap years, except years divisible by 100, except years divisible by 400. So 2000 was a leap year (divisible by 400), but 1900 was not (divisible by 100 but not 400). 2024 is a leap year, 2025 is not, 2028 will be.

The rule shifts the day-of-year for every date after February 28 by one in leap years. March 1 is day 60 in 2025 (common year) but day 61 in 2024 (leap year). December 31 is day 365 in a common year and day 366 in a leap year. The average Gregorian year is 365.2425 days, within 27 seconds of the true tropical year of 365.24219 days.

Did you know

The simple "divisible by 4" rule is wrong about three days every 400 years. Pope Gregory XIII added the century-and-400 exceptions in 1582 to fix the drift the Julian calendar had accumulated since 46 BC. Catholic Europe jumped straight from October 4 to October 15, 1582 to absorb the accumulated 10-day error.

ISO 8601 ordinal date format

ISO 8601 standardizes the ordinal date as YYYY-DDD. The day-of-year always carries three digits, padded with zeros. January 1 is YYYY-001, not YYYY-1. The format sorts lexicographically — alphabetical order matches chronological order — which makes it useful as a filename prefix or a database key for logs.

The closely-related ISO week date format is YYYY-Www-D, where ww is the week number (01-53) and D is the day of week (1 = Monday, 7 = Sunday). Both representations refer to the same calendar day but answer different questions.

Day of the year table

The cumulative days at the end of each month in a common year and a leap year:

  • Jan = 31 / 31
  • Feb = 59 / 60
  • Mar = 90 / 91
  • Apr = 120 / 121
  • May = 151 / 152
  • Jun = 181 / 182
  • Jul = 212 / 213
  • Aug = 243 / 244
  • Sep = 273 / 274
  • Oct = 304 / 305
  • Nov = 334 / 335
  • Dec = 365 / 366

To find the day of the year for, say, July 4, take the cumulative end-of-June number (181 or 182) and add 4. July 4, 2026 is day 185.

ISO week number vs day of the year

The two numbers answer different scheduling questions. Day of the year is a count from January 1; ISO week is a count of Monday-Sunday weeks anchored on the first Thursday of January. A year has 52 ISO weeks most of the time and 53 weeks when it starts on a Thursday (or on a Wednesday in a leap year).

2026 is a 53-week ISO year because January 1, 2026 is a Thursday. The last few days of December 2026 fall in W53 of 2026, and January 1, 2027 — a Friday — belongs to W53 of 2026 as well. The first ISO week of 2027 starts on Monday, January 4.

Tip

If a finance or payroll system uses 4-week or 13-period months, ISO week numbers line up cleanly with those periods. Ordinary day-of-year counts do not — day 28, day 56, day 84 are not Mondays in general.

Day of the year worked example

What is the day of the year for March 15, 2026? Take the end-of-February cumulative number for a common year (2026 is not divisible by 4): 59. Add the day of month: 59 + 15 = 74. So March 15, 2026 is day 74. The ISO ordinal form is 2026-074. Days remaining in 2026 from March 15 inclusive: 365 − 74 = 291 (counting March 15 as a remaining day) or 291 if you count the days strictly after the target date.

Inclusive or exclusive?

Software conventions differ on whether "days remaining" includes the start date. The calculator above uses the exclusive convention — March 15 is not in the remaining count. Add 1 to compare with tools that count inclusively.

Day of the year quick reference

  • Jan 1 = day 1
  • Mar 1 (common) = day 60
  • Mar 1 (leap) = day 61
  • Jul 4 = day 185 (common) / 186 (leap)
  • Dec 31 (common) = day 365
  • Dec 31 (leap) = day 366
  • Leap rule = ÷4, not ÷100, unless ÷400

One last note. The astronomical Julian Day Number for May 13, 2026 is 2,461,174. The ordinal date for the same day is 2026-133. The two are not interchangeable; only the ordinal form belongs in everyday calendar work.

FAQ

The day of the year, also called the ordinal date, is the position of a date inside its year, counted from 1. January 1 is day 1, January 31 is day 31, March 1 is day 60 in a common year and 61 in a leap year, and December 31 is day 365 or 366.
It applies the standard Gregorian rule: a year is a leap year if it is divisible by 4, except that years divisible by 100 are not leap years unless they are also divisible by 400. So 2024 is a leap year, 2025 is not, 2000 was a leap year, and 1900 was not.
ISO 8601 ordinal form writes a date as YYYY-DDD, with a three-digit day-of-year padded with leading zeros. April 10, 2026 is 2026-100. It is the most compact unambiguous way to write a date in plain text and is used by some logging and aerospace systems.
ISO 8601 anchors week 1 on the week containing the first Thursday of January. If January 1 falls on a Friday, Saturday, or Sunday, it belongs to the last ISO week of the previous year. January 1, 2026 is a Thursday, so it is in W01 of 2026. January 1, 2027 is a Friday and belongs to W53 of 2026.
An ISO year has 53 weeks when it begins on a Thursday, or on a Wednesday in a leap year. 2026 starts on Thursday, January 1, so it has 53 weeks (371 days). All other years have 52 weeks (364 days).
Add the cumulative days from a memorized table. Through January = 31, February = 59 (60 in leap years), March = 90 (91), April = 120 (121), May = 151 (152), June = 181 (182), July = 212 (213), August = 243 (244), September = 273 (274), October = 304 (305), November = 334 (335). Add the day of the month to the previous month's cumulative total.