ToolNimba

๐Ÿ“… Julian Date Converter

By ToolNimba Editorial Team ยท Updated 2026-06-20

Day of year (1 to 366)
-
5-digit Julian (YYDDD)
-
7-digit (YYYYDDD)
-

Year
Day of year
Calendar date
-
ISO 8601 (YYYY-MM-DD)
-

This Julian date converter turns any calendar date into its ordinal day-of-year, a number from 1 to 366, and the 5-digit YYDDD code used in manufacturing, logistics, and mainframe systems. It works both ways: pick a date to read its Julian day, or enter a year and a day-of-year to get the calendar date back. Leap years are handled automatically, so 29 February and day 366 always land correctly.

What is the Julian Date Converter?

The "Julian date" used in everyday business is not the astronomical Julian Day Number, it is the ordinal day-of-year: a count of how many days have passed since the start of the year, beginning at 1 for 1 January. Under this scheme 1 January is day 1, 1 February is day 32, and 31 December is day 365 in a common year or day 366 in a leap year. Because it is a single small number, it is compact to print on labels, stamp on food packaging, and store in legacy systems, which is why food producers, the military, and IBM mainframes have used it for decades.

The most common printed form is the 5-digit YYDDD code, where the first two digits are the last two digits of the year and the final three are the zero-padded day-of-year. So 20 June 2026 becomes 26171, because 2026 ends in 26 and 20 June is the 171st day of the year. A 7-digit YYYYDDD variant keeps the full year (2026171) to avoid the century ambiguity that two-digit years create. When you read a YYDDD code you must already know the century, since 26171 could mean 1926 or 2026.

Leap years are where ordinal dates trip people up. A year is a leap year when it is divisible by 4, except for century years, which must also be divisible by 400. So 2000 and 2024 are leap years with 366 days, but 1900 and 2100 are not. From 1 March onward, every day-of-year in a leap year is one higher than in a common year, because 29 February inserts an extra day. Day 60 is 1 March in a common year but 29 February in a leap year, which is the single most common source of off-by-one errors.

Converting a day-of-year back to a calendar date is just the reverse: subtract the length of each month in turn until the remaining count fits inside a month. This tool does that with the correct February length for the year you enter, validates that the day-of-year is within range (it rejects day 366 in a common year), and shows the weekday so you can cross-check the result against a calendar.

When to use it

  • Reading or printing the 5-digit YYDDD Julian code stamped on food, pharmaceutical, or industrial product labels.
  • Decoding a manufacturing or lot date that an ERP, WMS, or mainframe system stores as a day-of-year.
  • Filling in forms, spreadsheets, or aviation and military paperwork that ask for the ordinal day-of-year.
  • Checking that an automated batch or expiry calculation handled a leap year and day 366 correctly.

How to use the Julian Date Converter

  1. To get a Julian date, pick a calendar date in the top field, or click "Use today" to load the current date.
  2. Read the day-of-year (1 to 366), the 5-digit YYDDD code, and the 7-digit YYYYDDD code, then copy whichever you need.
  3. To go the other way, type a year and a day-of-year in the lower section.
  4. Read the full calendar date and the ISO 8601 form; if the day-of-year is out of range for that year, a message tells you the maximum.

Formula & method

Day-of-year = (sum of the lengths of all months before the current month) + day of month, adding 1 when the month is after February in a leap year. YYDDD = last two digits of the year, followed by the day-of-year padded to three digits. A leap year is any year divisible by 4, except century years that are not divisible by 400.

Worked examples

Convert 20 June 2026 to a Julian date.

  1. Add the lengths of January through May: 31 + 28 + 31 + 30 + 31 = 151 days.
  2. 2026 is not divisible by 4, so it is a common year and February has 28 days, no leap adjustment.
  3. Add the day of the month: 151 + 20 = 171, so 20 June is day 171.
  4. Take the last two digits of the year (26) and append the padded day (171) to get the YYDDD code.

Result: Day of year 171, YYDDD 26171, YYYYDDD 2026171.

Convert day-of-year 60 back to a date in the leap year 2024.

  1. 2024 is divisible by 4 and not a century, so it is a leap year and February has 29 days.
  2. Subtract January: 60 minus 31 leaves 29 days remaining.
  3. The 29 remaining days fit inside February, which has 29 days in 2024.
  4. So day 60 lands on 29 February 2024, not 1 March as it would in a common year.

Result: 29 February 2024 (in a common year, day 60 would instead be 1 March).

Day-of-year for the first of each month (common year vs leap year)

Month (the 1st)Common year dayLeap year day
January 111
February 13232
March 16061
April 19192
June 1152153
September 1244245
December 1335336
December 31365366

Sample YYDDD codes

Calendar dateDay of yearYYDDDYYYYDDD
1 January 20261260012026001
20 June 2026171261712026171
31 December 2026365263652026365
29 February 202460240602024060
31 December 2024366243662024366

Common mistakes to avoid

  • Forgetting the leap-year shift after February. From 1 March onward, every day-of-year in a leap year is one higher than in a common year. Day 60 is 1 March in a common year but 29 February in a leap year. Always check whether the year has 366 days before trusting a number past February.
  • Confusing the ordinal day-of-year with the astronomical Julian Day. The Julian Day Number used in astronomy is a continuous count of days since 4713 BC and runs into the millions. The business "Julian date" is just the day-of-year from 1 to 366. They share a name but are completely different numbers.
  • Reading a YYDDD code without knowing the century. A 5-digit code like 26171 only carries the last two digits of the year, so it could mean 1926 or 2026. You must supply the century from context. The 7-digit YYYYDDD form removes this ambiguity.
  • Allowing day 366 in a common year. A common year has only 365 days, so day 366 does not exist and a code like 26366 is invalid for 2026. Validate the day-of-year against the actual length of the year before converting it back to a date.

Glossary

Julian date (ordinal date)
In everyday business use, the day-of-year: a count from 1 to 366 of how many days have elapsed since 1 January, where 1 January is day 1.
Day of year
The position of a date within its year, from 1 for 1 January up to 365 or 366 for 31 December depending on whether the year is a leap year.
YYDDD
A 5-digit Julian code where the first two digits are the last two digits of the year and the final three are the zero-padded day-of-year, for example 26171.
Leap year
A year with 366 days, occurring when the year is divisible by 4, except century years which must also be divisible by 400. It adds 29 February.
ISO 8601
An international date standard. The calendar form is YYYY-MM-DD, and it also defines an ordinal form, YYYY-DDD, that matches the day-of-year used here.
Julian Day Number
A separate astronomical count of days since noon on 1 January 4713 BC, running into the millions. It is not the business Julian date this tool converts.

Frequently asked questions

What is a Julian date?

In everyday business use, a Julian date is the ordinal day-of-year: a number from 1 to 366 counting how many days have passed since 1 January. 1 January is day 1, 1 February is day 32, and 31 December is day 365 or 366. It is often printed as a 5-digit YYDDD code.

How do I convert a calendar date to a Julian date?

Pick the date in the top field of the converter. It instantly shows the day-of-year (1 to 366), the 5-digit YYDDD code, and the 7-digit YYYYDDD code. The tool adds the lengths of the earlier months and adjusts for leap years automatically.

What does the YYDDD format mean?

YYDDD is a 5-digit Julian code. The first two digits are the last two digits of the year, and the final three are the day-of-year padded with leading zeros. For example, 20 June 2026 is 26171 because 2026 ends in 26 and it is the 171st day of the year.

How do leap years affect the Julian date?

A leap year has 366 days because of 29 February, so from 1 March onward every day-of-year is one higher than in a common year. Day 60 is 1 March in a common year but 29 February in a leap year. This tool uses the correct February length for the year you enter.

Is this the same as the astronomical Julian Day Number?

No. The astronomical Julian Day Number is a continuous count of days since 4713 BC that runs into the millions. The business Julian date is simply the day-of-year from 1 to 366. They share a name but are entirely different numbers.

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

Enter the year and the day-of-year in the lower section of the converter. It returns the full calendar date, the weekday, and the ISO 8601 form. If the day-of-year is too large for that year, for example day 366 in a common year, the tool tells you the maximum allowed.