Day of the Year Calculator
Turn any Gregorian calendar date into its ordinal day number and see exactly how many days remain after that date.
Date
Required. Choose a valid Gregorian calendar date from year 0001 through 9999.
Results
Year-position check
221 elapsed days including the selected date + 144 later days = 365 days in 2026.
How to use the Day of the Year Calculator
What this calculator does
This calculator converts one calendar Date into its ordinal position within that Gregorian calendar year. January 1 is day 1. December 31 is day 365 in a common year or day 366 in a leap year. It also counts the Days left in year after the selected date, reports the total Days in year, and identifies whether the selected year is a Leap year. This is an exact calendar identity for the supported Gregorian date; it is not a business-day counter, holiday calendar, time-zone conversion, or elapsed-time calculation between two timestamps.
When to use it
Use an ordinal date when a project, log, scientific dataset, operations schedule, or filing convention refers to a date by its position from 1 through 365 or 366. It is also useful for checking how far a date sits into a year, finding the day number for a birthday or milestone, or translating a calendar date before comparing it with an ordinal-day dataset. NASA publishes an ordinal day calendar that illustrates the same day-of-year convention in regular and leap years.
How to calculate
- The calculator opens with a ready-to-use demonstration date, August 9, 2026. Its results are already calculated, and a validated example XLSX workbook is immediately available from Download Excel.
- Replace the Date with any valid date from year 0001 through 9999. The result panel updates automatically; there is no separate Calculate button.
- Read Day of year for the ordinal number and Days left in year for the count of dates after the selected date through December 31. Use Days in year and Leap year to understand whether February contributes 28 or 29 days.
- Select Download Excel to create a fresh workbook from the current validated date and current results. Select Reset to clear the demonstration/input date and all calculated results. After Reset, Excel export is disabled until you enter a complete valid date again.
Input guide
Date is the only required input. It is a calendar date entered through the native date control and represented internally in the unambiguous YYYY-MM-DD format. The accepted domain is 0001-01-01 through 9999-12-31. A realistic example is 2026-08-09. Moving the date later normally increases Day of year and decreases Days left in year. The important edge case is February 29: it is accepted only when the selected year follows the Gregorian leap-year rule. Avoid treating an ordinal day as a count that starts from zero; January 1 is day 1, not day 0.
Output guide
Day of year is an exact integer from 1 to 365 or 366. It is driven by the selected month and day plus the lengths of all preceding months. Days left in year is also an exact integer and excludes the selected date itself, so December 31 returns 0. Days in year is 365 for a common year and 366 for a leap year. Leap year displays Yes or No according to the Gregorian divisibility rule. The header pills repeat the selected date, ordinal day, remaining-day count, and common/leap-year status as a compact summary; they do not introduce separate calculations.
Worked example
The opening example uses August 9, 2026. Because 2026 is not a leap year, the completed months before August contain 31 + 28 + 31 + 30 + 31 + 30 + 31 = 212 days. Adding the first 9 days of August gives 212 + 9 = 221, so August 9 is day 221. A common year has 365 days, so the number of later days is 365 – 221 = 144. The year-position check therefore reads 221 elapsed days including the selected date + 144 later days = 365 days in 2026. These exact values also appear in the startup workbook.
Learn more
Leap years are the only reason the ordinal numbering after February can shift by one compared with a common year. NASA's explanation of why leap years contain 366 days gives useful context for the extra February 29 and the calendar-year adjustment.
How the ordinal-day formula works
The calculation is a cumulative month-length sum. Start with the day number inside the selected month, then add the number of days in every full month that came before it. In a common year, the month lengths are 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, and 31. In a leap year, February contains 29 days, so every date from March 1 through December 31 has an ordinal number one higher than the same month-and-day in a common year.
Day of year = days in completed months + day of current month Days left = days in selected year – day of yearThe Gregorian leap-year test has an important century exception: a year divisible by 4 is normally a leap year, but a year divisible by 100 is not unless it is also divisible by 400. That is why 2000 was a leap year while 2100 will not be. NASA JPL's leap-day math explanation describes this 400-year correction and why the calendar needs it.
Interpreting boundary dates
January 1 always returns day 1. In a common year, February 28 is day 59 and March 1 is day 60; in a leap year, February 29 is day 60 and March 1 is day 61. December 31 always returns the last ordinal number of the year and 0 days left. These boundaries make useful checks when you are validating imported records, converting date-coded filenames, or comparing data from years with different lengths.
“Day of year” or “ordinal day” is not the same thing as the astronomical Julian Day Number, which counts days continuously across years. This calculator always resets its count to 1 on January 1.
Common mistakes to avoid
- Do not subtract one from the displayed ordinal number. The convention used here is one-based, so January 1 is day 1.
- Do not assume every fourth year is automatically a leap year; century years must also be divisible by 400.
- Remember that Days left in year excludes the selected date. If you need an inclusive count that includes the selected date, add one.
- When moving data between systems, verify whether the other system says “ordinal day,” “day of year,” or “Julian day,” because those terms can be used differently in technical contexts.