πŸ“… Day of Year Calculator

Date to day number, day number to date. Leap years handled.

-

Day of the year

How to Use the Day of Year Calculator

Two directions. Date-to-number takes any calendar date and returns its day number (January 1 = 1) plus days remaining in the year. Number-to-date reverses it: enter a day number and year for the calendar date, leap-aware. Both are instant.

1

Pick the direction: date to number, or number to date.

2

Enter the date, or the day number and year.

3

Hit Convert. Read the day number, days left, or the date.

How Day Number Math Works

Day number = days in prior months + day of month Days left = 365 (or 366) - day number Reverse: subtract month lengths until the remainder fits

The forward direction sums the completed months and adds the current day. The reverse peels months off the day number until what remains fits inside a month. Leap years insert February 29 as day 60, shifting every later date by one.

Worked example, verified both ways: October 16, 2026. Prior months Jan to Sep: 31+28+31+30+31+30+31+31+30 = 273. Plus 16 = day 289. Days left: 365 - 289 = 76. Reverse: day 100 of 2026. Subtract January (31) β†’ 69, February (28) β†’ 41, March (31) β†’ 10, which fits in April β†’ April 10. In a leap year the same day 100 gives April 9, because February takes 29.

Oct 16, 2026Day 289
Days remaining76
Day 100 of 2026April 10
Day 100, leap yearApril 9

Where Day Numbers Get Used

Food packaging stamps them: a Julian-style code like 26289 means 2026, day 289, and inspectors read freshness at a glance. Manufacturers use them for lot tracking because 26289 sorts chronologically as text, no date parsing needed. The military's date-time groups embed day-of-year for compact, unambiguous timestamps. Programmers meet them in date libraries and log filenames. Hikers know day numbers from thru-hike planning; astronomers use a different but related continuous count. It is a small, boring, extremely useful numbering system hiding in plain sight.

The Leap Year Wrinkle

Everything after February shifts by one in leap years, and forgetting this causes the classic off-by-one. March 1 is day 60 normally but day 61 in a leap year; December 31 is 365 or 366. The rule: a year is a leap year if divisible by 4, except centuries, which must be divisible by 400. So 2024 and 2028 are leap years, 1900 was not, and 2000 was. The calculator applies this automatically, but when doing mental math across February in a leap year, add the extra day deliberately. Off-by-one errors in day numbers are almost always February's fault.

Tips for Working With Day Numbers

When reading package codes, the first two digits are usually the year and the last three the day: 26289 = 2026, day 289 = October 16. For year-end goals, the days-remaining figure is the actionable one: 76 days left reframes a yearly goal into a weekly pace. When scheduling across years, convert both endpoints to day numbers and subtract; it beats counting months on fingers. And for the 100th-day-of-school celebration, count instructional days from the district calendar, not calendar days: the party lands in late January or February, and the 100-themed crafts take longer than you think.

A Second Worked Example: The Lot Code

A package stamped 24310. The first two digits are the year, 2024; the last three are the day number, 310. 2024 is a leap year, so months through October sum to 305; 310 minus 305 is 5, giving November 5, 2024. The inspector reads packing date at a glance, no calendar needed. In a non-leap year the same code would read November 6, because February's missing day shifts everything after it.

Manufacturers love this format because 24310 sorts chronologically as plain text: no month names, no slashes, no ambiguity between US and international date orders. If you ever wondered why the code looks nothing like a date, sorting is why.

Ordinal Dates in Standards

The day-number format has a formal name: ordinal dates, standardized in ISO 8601 as YYYY-DDD, so October 16, 2026 is 2026-289. The standard exists to kill date-order ambiguity in international data exchange. Programmers meet ordinal dates in date libraries, log rotation schemes, and data pipelines where sortable, parseable dates matter.

Astronomers use a related but different count: the Julian day, a continuous day count from 4713 BCE with no months or years at all. Do not confuse the two; a Julian day number is in the millions and has nothing to do with day 289. Same idea, wildly different scale.

Common Day-Number Mistakes

First: the leap-year shift. February 29 is day 60 in leap years, pushing every later date one higher than in common years; day 100 is April 9 in a leap year, April 10 otherwise. Second: zero versus one indexing. January 1 is day 1, not day 0; programmers used to zero-indexed arrays trip on this constantly.

Third: the year rollover. Day 365 of a common year is December 31; day 366 does not exist, and entering it should error, not wrap. Fourth: two-digit year codes. The 24 in 24310 means 2024 by convention, but conventions vary by industry; confirm the century rule before reading old stock. Fifth: mixing Julian day with ordinal date. Both are called "Julian dates" colloquially; only the ordinal form is day-of-year.

Second Worked Example: The Birthday Countdown

Today is October 16, 2026, which is not a leap year. Add the months: January 31, February 28, March 31, April 30, May 31, June 30, July 31, August 31, September 30, which totals 273, plus 16 days of October gives day 289. Days remaining in the year: 365 minus 289 equals 76. That is the number behind every year-end countdown and every "days left in Q4" dashboard. Enter any date above and the calculator does this addition instantly, including the leap-year February adjustment.

Why Programmers Love Ordinal Dates

Software and logistics systems often write dates as year plus day number, like 2026-289 for October 16. This format, defined in ISO 8601, sorts chronologically as plain text, which regular month-day dates do not: "2026-289" always comes before "2026-300", while "10-16" versus "9-05" needs parsing. Manufacturing lot codes use the same idea, often as a Julian-style YYDDD stamp, so a code reading 6289 means day 289 of 2026. If you have ever wondered what those stamped numbers on packaging mean, this is usually it: the factory's way of writing the date without ambiguity.

The Doomsday Rule: Weekdays Without a Calendar

John Conway's Doomsday algorithm finds any weekday mentally: memorize the year's "doomsday," the weekday shared by 4/4, 6/6, 8/8, 10/10, 12/12, 5/9, 9/5, 7/11, 11/7, and the last day of February. In 2026, doomsday is Saturday, so 10/10 and 12/12 are Saturdays, and 10/16 is six days later: Thursday. Once you know one year's doomsday, next year's shifts by one weekday, or two after a leap year. Pair it with the day-number math above and you can answer "what day was day 200?" entirely in your head.

Frequently Asked Questions

What day of the year is October 16?

Day 289 in a common year (2026), day 290 in a leap year. The calculator above gives the day number for any date plus how many days remain in the year.

How do you calculate the day of the year?

Add up the days in all full months before the date, then add the day of the month. For October 16: Jan to Sep total 273 days, plus 16 = 289. Leap years add 1 for any date after February.

What date is day 100 of the year?

April 10 in a common year (31+28+31+10 = 100), April 9 in a leap year. Use the reverse mode above: enter the day number and year for the exact date.

What is a Julian date?

In everyday use, a Julian date is the two-digit year plus the day of the year: October 16, 2026 is 26289. (Astronomers use Julian date differently, as a continuous day count.) Food packaging, manufacturing lots, and the military use this format for compact date stamping.

How many days are left in the year?

365 (or 366) minus the day number. On day 289 of a common year, 76 days remain. The calculator shows this automatically, handy for year-end goal tracking.

What day number is February 29?

Day 60, in leap years only. That is why dates after February shift by one between leap and common years: March 1 is day 60 normally, day 61 in a leap year.

Why do manufacturers use day-of-year codes?

Compactness and sortability: 26289 sorts chronologically as plain text and fits in small print. One glance tells quality control exactly when a batch was made, which matters for recalls and freshness dating.

What is the 100th day of school?

Schools count instructional days, not calendar days, so the 100th day of school falls around late January to mid-February depending on the start date and holidays. It is a beloved early-elementary milestone, usually celebrated with 100-themed projects.

How do I convert day-of-year back to a date?

Subtract month lengths from the day number until the remainder fits in a month. For day 289: subtract Jan to Sep (273), leaving 16 β†’ October 16. The calculator's reverse mode does this instantly for any year, leap-aware.