Audited ·Last updated 31 Jul 2026·3 citations·Tier 2·0 uses

Day of the Year Calculator

Convert a date to its day-of-year number and back. Get the ISO 8601 ordinal date, days left in the year and the share of the year elapsed.

Day of the Year Calculator

Direction
Used in 'Date → day number' mode. ISO 8601 (YYYY-MM-DD).
Used in 'Day number → date' mode. The year decides whether day 366 exists.
Used in 'Day number → date' mode. 1 = 1 January; 365 or 366 = 31 December.
Answer
Day 210 of 2026 is Wednesday, 29 July 2026.
The conversion written as a sentence, in whichever direction you asked for.
Day of the year
210
ISO 8601 ordinal date
2026-210
Calendar date
2026-07-29
Day of the week
Wednesday
Days left in the year
155 days
Year elapsed
57.53
Days in that year
365 days

Background.

This calculator converts between a calendar date and its day-of-year number, in both directions. Give it 27 October 2026 and it returns day 300. Give it day 300 of 2026 and it returns 27 October. Alongside the number it reports the ISO 8601 ordinal date form (2026-300), the weekday, how many days are left in that year, and what share of the year has elapsed.

The reverse direction is the reason this page exists as its own tool. Turning a date into a day number is something several calendars will do for you as an aside — including this site's own day of the week calculator, which reports the day-of-year alongside the weekday and the ISO week number. Turning a day number back into a date is the harder half and the one that is usually missing, and it is the half you need when you are reading a data file, a satellite log, a crop-trial sheet or an aviation record where dates were stored as ordinals in the first place.

The ordinal date is not an obscure convention. It is one of the date representations defined by ISO 8601 itself, written YYYY-DDD, where DDD runs from 001 to 365 — or to 366 in a leap year. The standard's own worked example is 1981-04-05, which is 1981-095. POSIX defines the same value as the %j conversion in strftime, described there as 'the day of the year as a decimal number [001,366]'. Fields that work with day-of-year arithmetic constantly — meteorology, agronomy, aviation, spacecraft operations — reach for it because subtracting two ordinals inside the same year is trivial, while subtracting two calendar dates is not.

Two conventions are worth stating plainly before you use the numbers, because getting either one backwards produces an answer that is wrong by exactly one. First, 1 January is day 1, not day 0. The ordinal is a position, not an elapsed count, so it is always one higher than 'days since 1 January'. If you are feeding the number into a system that counts from zero, subtract one. Second, days left in the year counts the days after the given date, so 31 December always shows zero rather than one, and the share of the year elapsed treats the given day as complete, so 31 December is exactly 100%.

Leap years are handled by the full Gregorian rule rather than a shortcut: divisible by four, except century years, except century years divisible by 400. 2024 and 2000 are leap years; 1900 and 2100 are not. That rule decides three things on this page at once — whether 29 February exists, whether the year has a day 366, and where every date after February sits in the count. Ask for day 366 of a common year and the calculator refuses and tells you why, rather than quietly rolling into the next January.

One thing this page deliberately does not do is ISO week numbers. Week numbering is a separate system with a different year boundary — week 1 is the week containing the year's first Thursday, which is why 1 January 2021 belongs to week 53 of 2020 — and the day of the week calculator owns that output. Two pages offering separate opinions on the same tricky boundary is how a catalog starts disagreeing with itself.

What is day of the year calculator?

An ordinal date, sometimes loosely called a Julian date in industry (a different thing from the astronomical Julian Day used for star charts), identifies a day by its year and its position within that year rather than by a month and a day-of-month. ISO 8601 writes it YYYY-DDD: 2026-300 is the 300th day of 2026. The representation has two properties that make it popular in technical work. Arithmetic inside a year is subtraction — day 300 minus day 210 is 90 days, with no month-length table involved. And sorting is lexicographic, so a list of zero-padded ordinal dates sorts into chronological order as plain text. Its limitations are the mirror image: it says nothing about the month, it cannot be compared across years without knowing whether a leap day sits between the two, and the same ordinal points at a different calendar date in a leap year than in a common year — day 60 is 29 February in 2024 and 1 March in 2026.

How to use this calculator.

  1. Pick the direction. 'Date → day number' takes a calendar date; 'Day number → date' takes a year and an ordinal.
  2. In 'Date → day number' mode, enter the date as ISO 8601 (YYYY-MM-DD). The year and day-number fields are ignored in this mode.
  3. In 'Day number → date' mode, enter the year first — it decides whether day 366 exists — then the day number from 1 to 365 or 366.
  4. Read the answer sentence, then the supporting figures: the ISO ordinal form to paste into a system that expects YYYY-DDD, the weekday, the days left in that year, and the share of the year elapsed.
  5. If you need the ISO week number as well, use the day of the week calculator — week numbering follows a different year boundary and is deliberately not duplicated here.

The formula.

DDD = 1 + (date − Jan 1 of that year) ⁄ 86400000 date = Jan 1 + (DDD − 1) days

Forward, the calculation is a subtraction. The date and 1 January of the same year are both converted to UTC-midnight instants, the difference is divided by the number of milliseconds in a day, and one is added because 1 January is day 1 rather than day 0. Anchoring both ends in UTC matters: a naive local-time implementation shifts by an hour at each daylight-saving transition, and an hour lost at midnight becomes a whole day lost in the ordinal.

Reverse, it is the same subtraction rearranged. One is taken off the day number, that many days are added to UTC midnight of 1 January, and the resulting instant is read back as a year, month and day. No month-length table is consulted in either direction — the calendar's own leap-year handling does the work, which is why the century cases (1900 is not a leap year, 2000 is) come out right without a special case.

The supporting figures follow from the two ordinals. The year's length is 366 when the Gregorian rule makes it a leap year and 365 otherwise. Days remaining is that length minus the ordinal, which is zero on 31 December by construction. The share of the year elapsed is the ordinal divided by the year's length, times 100, computed in arbitrary-precision decimal and rounded only at the end — so 27 October 2026, day 300 of 365, gives 82.1917808219%, and 31 December gives exactly 100 rather than 99.99999999999999.

The day-number field is validated against the year rather than against a fixed ceiling of 366. Day 366 of 2024 is 31 December; day 366 of 2026 does not exist, and the calculator says so in those words instead of rolling forward into 1 January 2027, which is what an unchecked implementation would silently do.

A worked example.

Example

Take 27 October 2026. Adding up the months before October — 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 — gives 273 days through the end of September, and 273 + 27 is 300. So 27 October 2026 is day 300 of 2026, written 2026-300 in ISO 8601 ordinal form, and it falls on a Tuesday. 2026 is not a leap year (2026 is not divisible by 4), so the year has 365 days: 365 − 300 leaves 65 days remaining, and 300 ÷ 365 × 100 gives 82.1917808219% of the year elapsed. Run the calculator the other way — day 300 of 2026 — and it returns 27 October 2026 again, which is the round trip the test suite checks for all 365 days of 2026 and all 366 days of 2024. Change the year to 2024 and the same ordinal lands somewhere else entirely: day 300 of 2024 is 26 October, one day earlier on the calendar, because the leap day sits between 1 January and the ordinal.

date2026-10-27
modedateToDay
year2,026
day Number210

Frequently asked questions.

Is 1 January day 0 or day 1?
Day 1. The ordinal is a position within the year, not a count of elapsed days, so 1 January is 001 and 31 December is 365 or 366. This is what ISO 8601 specifies and what POSIX's strftime %j produces, and it is the single most common off-by-one in day-of-year work: if the system you are feeding counts elapsed days from 1 January, subtract one from the number this calculator gives you.
Why does the same day number give a different date in a leap year?
Because the extra day is inserted at the end of February, so every ordinal after it shifts by one. Day 60 is 29 February in 2024 but 1 March in 2026. Day 300 is 26 October in 2024 and 27 October in 2026. This is why an ordinal date is only meaningful together with its year, and why comparing ordinals across years is unsafe unless you know how many leap days sit between them.
Is this the same thing as a Julian date?
No, though the industry usage is confusingly close. Manufacturing, food packaging and aviation often call the ordinal day-of-year a 'Julian date', and that is the value this page computes. The astronomical Julian Day is a different quantity entirely — a continuous count of days since noon on 1 January 4713 BC in the Julian proleptic calendar, running past 2.4 million today, used for star charts and orbital work. If you need that one, use the Julian date calculator in the science category instead.
What happens if I ask for day 366 of a year that is not a leap year?
The calculator refuses and tells you the year has only 365 days. It does not roll forward into 1 January of the following year, which is what an implementation without a range check does — and that silent roll-forward is exactly the kind of off-by-one that survives testing, because it only appears once every four years and only on one input.
How is 'percent of the year elapsed' defined?
As the day number divided by the number of days in that year, times 100 — so the given day counts as complete. On 31 December it is exactly 100%, and on 1 January of a common year it is 0.2739726027%. It deliberately ignores the time of day: this is a calendar-date tool, not a clock, and a figure that changed through the day would not be reproducible. If you need hours and minutes, use the countdown timer.
Does the day of the week calculator not already show me this?
For the forward direction, yes — it reports the day-of-year alongside the weekday and the ISO week number for any date you give it, and if that is all you need it is the shorter route. This page exists for the reverse direction, which that page cannot do: turning a day number back into a calendar date. It also adds the days remaining, the share of the year elapsed, and the ISO ordinal string itself. In the other direction, ISO week numbers are deliberately left to that page rather than duplicated here.
Which calendar does this use for very old dates?
The proleptic Gregorian calendar — the modern leap rule projected backwards past the 1582 reform. That is what virtually all date software does and it is internally consistent, but it is not the calendar that was in civil use at the time in most of the world: Britain and its colonies did not adopt the Gregorian calendar until 1752, and Russia not until 1918. Treat ordinals for very old dates as arithmetic rather than as history.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 977 calculators remain free
  • No billing is enabled
Coming soon