Pick a date and the calculator returns its position in the calendar year — Jan 1 is day 1, Jan 2 is day 2, and Dec 31 is day 365 (or 366 in a leap year). The number is what astronomers, satellite operators, and many backend systems call the **ordinal date** or **day-of-year** (DOY). It's the integer that, paired with a four-digit year, uniquely identifies a calendar day without month/day ambiguity. The calculator also shows days remaining in the year and whether the current year has 365 or 366 days. For the standard ordinal-date format with a leading zero year (e.g. 2026-185), use the ordinal-date tool; for a year-progress visualization, see year progress.
Common use cases
- Tagging filenames or build artifacts. Build systems often tag artifacts as "build-2026.185" — that's day-of-year for July 4. The format is sortable as a string, immune to month/day ambiguity, and shorter than ISO 8601's YYYY-MM-DD. Look up the day number for the date you want to backdate to, then concatenate.
- Reading a Julian day from satellite or weather data. Many weather and Earth-observation feeds quote dates in YYYYDDD format (the four-digit year followed by the three-digit day-of-year, zero-padded). To translate "2026185" back to July 4, drop the first four digits and look up day 185 with this calculator. The other direction works the same way: enter the date, get the day number, prepend the year.
- Counting how many days are left in the year. For end-of-year goals (sales targets, reading challenges, fundraising drives) you need to know exactly how many days remain. Enter today's date; the calculator shows the day number and the days-remaining count. For a richer breakdown including business-days-remaining and weekly progress, see year progress.
- Comparing the same day across leap and non-leap years. February 29 only exists in leap years, so days after Feb 29 sit at a different day-of-year number. March 1 is day 60 in 2025 (non-leap) but day 61 in 2024 (leap). Enter both dates to see the +1 shift. The same shift propagates through the rest of the year — Dec 31 is day 366 in leap years, day 365 otherwise.
How it works
The calculator parses your input as a UTC date, then counts the number of days from January 1 of that year to your date inclusive. Internally it calls date-fns getDayOfYear, which uses the standard 1-indexed convention (Jan 1 = 1, not 0). January gives values 1–31, February 32–59 (or 60 in leap years), and so on. The leap-year math is automatic: if the input year is divisible by 4, except divisible by 100, except divisible by 400, then February has 29 days and dates after Feb 29 shift up by one.
Worked examples
July 4 in 2026
Enter 2026-07-04.
Result: Day 185 of 365.
2026 is not a leap year, so February has 28 days and July 4 falls on day 185. (Jan 31 + Feb 28 + Mar 31 + Apr 30 + May 31 + Jun 30 + 4 = 185.) The same date in a leap year would be day 186.
Leap-year shift on March 1
Enter 2024-03-01.
Result: Day 61 of 366.
2024 is a leap year — February had 29 days — so March 1 lands one day later in the year than usual. The same date in a non-leap year (e.g. 2025-03-01) sits on day 60.
Non-leap-year March 1
Enter 2025-03-01.
Result: Day 60 of 365.
March 1 in any non-leap year is exactly day 60: 31 days of January + 28 days of February + 1 = 60. Day 60 in a leap year is the last day of February, not the first day of March.
Edge cases & gotchas
- Day numbers are 1-indexed, not 0-indexed. January 1 is day 1, not day 0. This matches the convention used by NASA, NOAA, and most almanacs. Some scientific software (notably old Fortran code and a handful of astronomy libraries) uses 0-indexing where January 1 is day 0; if you're feeding the result into such a system, subtract one before passing it through.
- Leap years have 366 days, not 365. A year divisible by 4 (but not by 100, except by 400) has 366 days. The extra day is February 29. Day-of-year values from March 1 onward are exactly one higher in leap years than in non-leap years. Use the leap year tool to check whether a given year is leap.
- Time zone does not affect the answer. The calculator interprets your input as UTC midnight, but day-of-year is invariant under time-zone shifts as long as the calendar date is the same. "March 1 in New York" and "March 1 in Tokyo" both yield day 60 (or 61 in a leap year). The calculator does not need to know your time zone.
- Year boundaries are sharp. There's no day 0 and no day 367. December 31 of any year is day 365 or 366; January 1 of the next year is day 1. The calendar resets cleanly at midnight UTC on January 1. ISO 8601 ordinal dates are written as YYYY-DDD with a hyphen between year and day, e.g. 2026-185.
Frequently asked questions about Day of Year Calculator
Is "day of year" the same as "Julian date"?
Almost, but not quite. "Day of year" or "ordinal date" is the count from Jan 1 of the calendar year (1–365/366). "Julian date" in astronomy is the continuous count of days since November 24, 4714 BC at noon UTC — currently around 2,460,000. The two are easily confused; use the Julian day calculator for the astronomical sense.
Why does day-of-year matter for software?
It compresses a date into one integer per year, which is useful for log filenames, satellite data feeds, GPS week numbering, and anything where you want a sortable, time-zone-free identifier. It's also the natural index for year-progress dashboards.
Is day 366 the same date every leap year?
Yes — December 31 of every leap year is day 366. (And December 31 of every non-leap year is day 365.) The leap day is February 29, which is day 60; everything from March onward shifts up by one in leap years.
What happens for years before 1582 (pre-Gregorian)?
The calculator applies the Gregorian rule unconditionally, even for pre-1582 dates ("proleptic Gregorian"). For dates that were recorded under the Julian calendar at the time, the day-of-year answer will differ by 10–13 days from the historical record. For Julian-calendar work, apply the rule by hand: every fourth year is leap, no exceptions.
Why does my satellite-data file show "2026185" instead of a date?
That's the YYYYDDD format: the 4-digit year followed by the zero-padded day-of-year. 2026185 means day 185 of 2026 (July 4). Use this calculator to translate either direction. Some files also use 2-digit years (YYDDD), which becomes ambiguous around the millennium and is best avoided.
Is there a one-line formula I can use without this calculator?
For a non-leap year, days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; sum the first month-1 entries and add the day. For leap years, change the second entry from 28 to 29. The calculator does this for you so you don't have to remember the array.
Glossary
- Day-of-year (DOY)
- The 1-indexed position of a calendar date within its year. Jan 1 = 1, Dec 31 = 365 or 366. Also called "ordinal day" or "Julian day-of-year" (despite the latter name being potentially confusing with astronomical Julian dates).
- Ordinal date
- ISO 8601 short-form date written as YYYY-DDD, where DDD is the zero-padded day-of-year. 2026-07-04 in ordinal form is 2026-185. Useful when the month/day decomposition isn't needed.
- Leap year
- A year divisible by 4, except those divisible by 100, except those divisible by 400. Has 366 days instead of 365; the extra day is February 29.
- YYYYDDD format
- Compact date encoding used in satellite, weather, and GPS data. Concatenates the 4-digit year and the 3-digit zero-padded day-of-year into a 7-digit integer. 2026185 = July 4, 2026.
- Julian date
- In astronomy, the continuous day count starting noon UTC on January 1, 4713 BC (proleptic Julian calendar). Distinct from "day-of-year"; today's Julian date is ~2,460,778. See the Julian day tool.