ToolNimba

๐Ÿ“… Julian Date Converter

Shihab Mia By Shihab Mia ยท Updated 2026-08-04

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; a common convention treats 00 through 50 as 2000 to 2050 and 51 through 99 as 1951 to 1999, but this is a convention, not a rule, so context always wins.

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.

The business YYDDD code is unrelated to the astronomical Julian Day Number (JDN), even though both share the word "Julian". The JDN is a single continuous count of days since noon on 1 January 4713 BC, used by astronomers so any two dates, however far apart, can be subtracted with plain arithmetic. Scientists and satellite operators often use the Modified Julian Date (MJD) instead, which is the JDN minus 2,400,000.5, giving smaller, easier numbers that start counting from 17 November 1858. A rarer 4-digit YJJJ code, with a single-digit year and a 3-digit day-of-year, also turns up in some older systems; it is even more ambiguous than YYDDD and should be avoided for anything that needs to last more than a decade.

Outside computing, Julian day-of-year codes are printed directly on physical products. Egg cartons, canned goods, and pharmaceutical blister packs often carry a 5-digit "pack date" or "best by" code in exactly this YYDDD format, and military and aerospace supply chains stamp ammunition, parts, and maintenance logs the same way. It also helps to know that the historical "Julian calendar" introduced by Julius Caesar in 45 BC, and still used for religious observances in some Orthodox churches, is a completely different thing from the Julian date ordinal numbering described here; the shared name is a common source of confusion but the two systems have nothing to do with each other.

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.
  • Decoding the Julian "pack date" or "best by" code printed on egg cartons, canned goods, or ammunition boxes.
  • Converting a day-of-year value pulled from a CSV export, log file, or a programming function such as Python's strftime "%j" into a readable calendar date.

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.
Calendar Date to Julian Date20 Jun 2026->Day of year171->YYDDD (5-digit)26171YYYYDDD (7-digit)2026171Leap years add 1 to every day-of-year from 1 March onward

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).

Decode the Julian code 24007 printed on a carton of eggs.

  1. Split the 5 digits into a 2-digit year (24) and a 3-digit day-of-year (007).
  2. Using the common century-cutoff convention, a YY of 00 through 50 maps to 2000 through 2050, so 24 means 2024.
  3. Day-of-year 7 is well within January, since January has 31 days.
  4. Counting 7 days from 1 January lands on 7 January.

Result: 7 January 2024 (the carton was packed on the 7th day of 2024).

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

Julian date formats compared

FormatStructureExample for 20 June 2026Typical use
Day of year1 to 366171Programming date functions, internal counters
YYDDD (5-digit)YY + DDD26171Food, pharmaceutical, and industrial packaging; mainframes
YYYYDDD (7-digit)YYYY + DDD2026171Aerospace, defense, and long-retention records
YJJJ (4-digit)Y + DDD6171Older single-digit-year systems; rare and easy to misread
Julian Day Number (JDN)continuous count since 4713 BCapprox. 2,461,212Astronomy and calendar arithmetic
Modified Julian Date (MJD)JDN minus 2,400,000.5approx. 61,211Satellite operations, GPS, and scientific timestamps

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. A common convention reads 00 through 50 as 2000 to 2050 and 51 through 99 as 1951 to 1999, but this is only a convention, not a guarantee. The 7-digit YYYYDDD form removes the ambiguity entirely.
  • 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.
  • Mixing up the Julian date with the Julian calendar. The historical Julian calendar, introduced by Julius Caesar and still used by some Orthodox churches for religious dates, is an entirely different system from the ordinal day-of-year numbering covered here. Sharing the word "Julian" is the only thing they have in common.
  • Assuming every system starts counting at day 1. Some legacy systems and programming languages index the day-of-year from 0 instead of 1, which shifts every converted date by a day. Check a known reference date, such as 1 January, before trusting an unfamiliar system's day-of-year output.

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 (JDN)
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.
Modified Julian Date (MJD)
The Julian Day Number minus 2,400,000.5, used in satellite operations, GPS, and scientific timestamps because it produces smaller, more manageable numbers that start counting from 17 November 1858.
Julian calendar
The calendar introduced by Julius Caesar in 45 BC and replaced by the Gregorian calendar in most countries. It is unrelated to the Julian date ordinal numbering despite the shared name.

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.

Is the Julian date the same as the Julian calendar?

No. The Julian calendar is a historical calendar system introduced by Julius Caesar in 45 BC and still used for religious dates by some Orthodox churches. The Julian date covered here is simply the ordinal day-of-year, from 1 to 366. The two only share a name.

What is today's Julian date?

Click "Use today" in the converter to load the current date and instantly see its day-of-year, YYDDD code, and YYYYDDD code. Because the value changes every day, it is calculated live rather than shown as a fixed number.

How do I calculate a Julian date in Excel?

For a date in cell A1, the formula =TEXT(A1,"yy")&TEXT(A1-DATE(YEAR(A1),1,0),"000") returns the 5-digit YYDDD code. DATE(YEAR(A1),1,0) returns 31 December of the previous year, so subtracting it from A1 gives the day-of-year, which is then padded to three digits.

What century does a 2-digit year in a Julian code refer to?

There is no universal rule. A common software convention reads 00 through 50 as 2000 to 2050 and 51 through 99 as 1951 to 1999, but individual companies and systems can define this differently. Always confirm the century from context, or use the 7-digit YYYYDDD format to avoid the ambiguity entirely.