The ordinal day of the year — day 1 for 1 January through to day 365 or 366 for 31 December — is a compact way of writing a date that appears far more widely than most people notice. It is on food production codes, in agricultural and meteorological records, in manufacturing lot numbers and in scientific datasets. This day of year calculator converts in both directions: a date to its day number, and a day number back to a date.
Arb Digital keeps a free tools library of the small conversions people otherwise do by counting on a calendar. This one is narrow by design. It answers where a date sits within its own year, and nothing about the relationship between two dates.
What This Day of Year Calculator Does
In the forward direction it takes a date and returns its ordinal position in the year, along with how many days are left, the ISO week the date falls in, the percentage of the year elapsed, and whether the year is a leap year. In the reverse direction it takes a year and a day number and returns the calendar date, with the same supporting figures.
There is also a numbering-base option, because although every standard counts 1 January as day 1, plenty of software counts it as day 0. Being able to switch is more useful than arguing about which is right when you are reconciling two systems that disagree.
The site already has a full set of date tools and this one deliberately does not overlap them. The add days to date calculator shifts a date by an interval. The date difference calculator measures the gap between two dates you already have. The days until date calculator counts down from today to a fixed future date. The day of week calculator returns the weekday. The week number calculator handles ISO week numbering in depth, and the leap year calculator settles whether a given year has 366 days. Every one of those involves two dates or a shift. This page involves exactly one date and its position inside its own year.
How to Use It
- Choose the direction. Date to number for reading a date off a calendar, number to date for decoding a code that gives you the ordinal.
- Enter the date, or the year and day number. The year matters in both directions, because a leap year shifts every day number after February.
- Check the numbering base. Leave it at day 1 unless you know the system you are reconciling with counts from zero.
- Read the days remaining. It is the figure that makes ordinal dates useful for planning: day 234 of 365 means 131 days left, immediately.
- Note the leap-year flag. If it says yes and your date is after February, remember every published common-year table is one day out.
The Formula: Cumulative Month Lengths
The ordinal day number is the sum of the lengths of all completed months plus the day of the month:
day of year = days in all previous months + day of month
The cumulative totals to the end of each month in a common year are 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 and 365. In a leap year, add one to every total from the end of February onwards.
Worked example. 22 August 2026. The months before August contribute 31 + 28 + 31 + 30 + 31 + 30 + 31 = 212 days, since 2026 is not a leap year. Adding 22 gives day 234. The year has 365 days, so 365 − 234 = 131 days remain, and 234 ÷ 365 = 64.1% of the year has elapsed.
The reverse works by subtraction. Given day 234 in 2026, take off the cumulative totals until the remainder falls inside a month: 234 is greater than 212 (end of July) and not greater than 243 (end of August), so the date is in August, on day 234 − 212 = 22. Hence 22 August.
The tool does both by converting to and from a millisecond timestamp rather than by table lookup, which removes the leap-year branch entirely and is the reason it never returns the classic off-by-one after February.
Leap Years, and the Rule That Is Not "Every Four Years"
A year is a leap year if it is divisible by 4, except that century years must also be divisible by 400. So 2000 was a leap year, 1900 was not, and 2100 will not be. That correction exists because the tropical year is close to 365.2422 days rather than 365.25, and adding a day every four years overshoots by about three days every four centuries.
The practical consequence for ordinal dates is that day 60 is 1 March in a common year and 29 February in a leap year, and every subsequent day number is shifted by one. Any printed day-of-year table therefore comes in two versions. University extension services that publish these tables for agricultural record-keeping — New Mexico State University's guide to the Julian date calendar for livestock management is a clear example — publish separate leap and common-year sheets for exactly this reason, because a breeding or withdrawal date calculated on the wrong sheet is a day out.
A related subtlety: leap seconds are not leap days and have no effect here. They adjust UTC by one second to track the Earth's rotation, as the NIST Time and Frequency Division documents, and they never change the number of days in a year.
Ordinal Dates in ISO 8601, and What "Julian" Really Means
The ordinal date has a formal written form. ISO 8601 defines it as YYYY-DDD with the day number always written as three digits, so 22 August 2026 is 2026-234 and 5 January is 2026-005. The zero padding is not decorative: without it, sorting text dates puts day 100 before day 99.
The same standard defines the ISO week date, which is a different scheme entirely — weeks start on Monday and week 1 is the week containing the first Thursday of the year, so 1 January can belong to week 52 or 53 of the previous year. The week number shown in the grid follows that rule. It is reported here as context, not as an alternative answer, and the week-number tool linked above covers its edge cases properly.
One naming warning. The ordinal day number is very often called a "Julian date", especially in agriculture, food manufacturing and military logistics, and that usage is technically wrong. A true Julian Day Number is a continuous count of days since a fixed epoch in 4713 BC, used in astronomy, and it runs into the millions. When somebody hands you a five-digit "Julian date" they mean the astronomical count; when they hand you a three-digit one, or a five-digit code with the year at the front, they mean the ordinal day of the year. Establish which one is meant before decoding anything.
Where Ordinal Day Numbers Turn Up
Food and pharmaceutical manufacturers stamp lot codes containing the ordinal day, often as a year digit followed by three day digits, because it is compact and unambiguous across languages and date-format conventions. That last point matters more than it sounds: 03/04 is two different dates depending on which side of the Atlantic it was printed, whereas day 63 is day 63 everywhere.
Agriculture and meteorology use it for record-keeping and for growing-degree-day accumulation, where the day number is the natural x-axis for a season. Aviation and defence logistics use it in serial and batch numbering. Scientific datasets use it because a single integer per year is far easier to plot and to difference than a month-and-day pair.
The one place it causes trouble is at year boundaries. Day numbers reset on 1 January, so an interval that crosses the new year cannot be found by subtracting two day numbers — day 5 minus day 360 is not a sensible answer. For anything that spans a year end, use the date difference calculator instead, which works on the underlying dates.
Arb Digital's free tools library covers date, time and planning maths alongside hundreds of other everyday calculations, and our team is happy to talk through anything the tools cannot answer.
Browse Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Using a common-year table in a leap year — every day number after 28 February is one higher. This is the single most frequent error.
- Subtracting day numbers across a year boundary — they reset on 1 January, so the difference is meaningless. Work from the dates instead.
- Confusing the ordinal day with a Julian Day Number — the astronomical count runs into the millions and starts in 4713 BC.
- Dropping the leading zeros — ISO 8601 ordinal dates are three digits, and unpadded numbers sort incorrectly as text.
- Assuming zero-based numbering — standards count 1 January as day 1, though some software libraries do not. Check before reconciling two systems.
Related Free Tools From Arb Digital
Use the date difference calculator for the gap between two dates, the add days to date calculator to shift a date by an interval, the week number calculator for ISO week numbering in detail, the leap year calculator to confirm a year's length, and the day of week calculator for the weekday alone. Everything else is in the free online tools hub.
Frequently Asked Questions
Add the lengths of all the complete months before it to the day of the month. For 22 August in a common year that is 212 plus 22, which is day 234 of 365.
365 in a common year and 366 in a leap year. The extra day is 29 February, which is day 60, so every day number after it shifts by one in a leap year.
Not strictly. The ordinal day of the year runs from 1 to 366 within a single year, while a true Julian Day Number is a continuous count of days since 4713 BC and runs into the millions. The loose usage is common in agriculture and manufacturing.
As YYYY-DDD with the day number padded to three digits, so 22 August 2026 is 2026-234 and 5 January 2026 is 2026-005. The padding keeps text sorting correct.
Only within the same year. Day numbers reset on 1 January, so any interval crossing a year end has to be worked out from the dates themselves rather than from the ordinals.
A week number calculator returns the ISO week a date falls in, which runs from 1 to 52 or 53 and starts on a Monday. This page returns the day number from 1 to 366 within the calendar year.
Because some software libraries count from zero rather than one. Every published standard and table treats 1 January as day 1, so switch the numbering base here when reconciling with a zero-based system.
This tool performs calendar arithmetic on the proleptic Gregorian calendar. Historical dates before the Gregorian reform were recorded on other calendars, and lot codes may use manufacturer-specific schemes rather than the standard ordinal date.