Guide
Day of the year: converting dates to day numbers and back, with the ISO ordinal date
The day of the year is the position of a date in its year, counting 1 January as day 1. It is used in logs, in weather and agriculture records, in food and manufacturing batch codes and by programmers who need a single number for a date within a year. Finding it by hand means adding the lengths of the months before the date and remembering leap years. This page does it both ways.
Date to day number
Type a date, or leave the field empty to use today. The page adds up the days of the earlier months, with February counted as 29 in a leap year, and then adds the day of the month. The result is shown as the day number out of 365 or 366, with the weekday, the ISO ordinal date, the days left, the share of the year passed, the quarter, the ISO week and the number of days in that month.
Day number to date
Choose the second mode, enter a year and a number from 1 to 366, and the page returns the date. Day 366 is accepted only in a leap year, and the limit is shown in the message when you ask for it in an ordinary year. The reverse lookup uses the same day count in both directions, so a date turned into a number and back always returns the original.
The ordinal date
ISO 8601 allows a date to be written as the year, a hyphen and a three-digit day number, for example 2024-061. It is compact, sorts correctly as text and avoids month names, which is why logs and data files use it. The page prints it for every result. Some industries use a shorter form with a two-digit year and the day number, such as 24061, which you can read straight off this line.
Edge cases
The year must be from 1 to 9999. Dates are typed as YYYY-MM-DD, and impossible dates are rejected. After February the day number of a calendar date differs by one between ordinary and leap years, so a stored day number only makes sense together with its year. The share of the year gone is the day number divided by the length of the year, which is 366 days in a leap year.
A worked example
1 March 2024 is day 61 of 366, a Friday, with 305 days left, 16.667% of the year gone, in the first quarter and in ISO week 9. The ordinal date is 2024-061. The last day of 2023 is day 365 of 365 with nothing left. Day 100 of 2026 is Friday 10 April, in ISO week 15, with 265 days left and 27.397% of the year gone, in the second quarter, with 30 days in April. Day 366 of 2024 is Tuesday 31 December, and it falls in ISO week 1 of 2025.
Limits
The page numbers days in the Gregorian calendar only. It does not produce the Julian Day Number used in astronomy, which counts days from a date in 4713 BC, so use the Julian date converter for that. It also does not handle fiscal years that start in another month, where the day count would begin on a different date.
Related tools
- Julian Date Converter gives the astronomers’ running day count and the Julian calendar date.
- Date Calculator adds a number of days to a date and returns the new date.
- Week Number Calculator gives the matching ISO and US week for the same date.
- Leap Year Calculator explains why the day numbers shift after February.
Checked against the current version of the Day of the Year Calculator on .

