Julian Date Converter
Convert ordinal dates (YYYY-DDD / YYDDD) to calendar dates, and calendar dates with a UTC time to astronomical Julian dates (JD) and Modified Julian Dates (MJD) — or back the other way. Includes a live day-of-year clock and a day-of-year table for the current year.
Convert Between Calendar Dates, Ordinal Dates and Julian Day Numbers
Julian Date Formula
Where:
- \(d, m, y\) — day, month and year of a Gregorian calendar date
- \(t\) — the time of day expressed in seconds after 00:00 UTC
- \( \lfloor \cdot \rfloor \) — the floor function (rounding down to the nearest integer)
- JDN — the Julian day number, an integer that labels one whole calendar day
The first two lines are the Fliegel–Van Flandern algorithm: they turn a calendar date into the continuous count of days that started on 1 January 4713 BC. The third line adds the fraction of the day; because the astronomical Julian day begins at 12:00 UTC, a time of noon produces a whole-number JD and midnight produces a JD ending in .5. Ordinal dates use the same day numbering within a single year: the ordinal date YYYY-DDD simply replaces the month and day with the day-of-year number.
Julian Date – Calculation Example
Example: the ordinal date 2024-173 (written 2024173 or 24173 in compact form) — day 173 of 2024, a leap year.
\[ 31 + 29 + 31 + 30 + 31 = 152, \qquad 173 - 152 = 21 \;\Rightarrow\; 21\ \text{June}\ 2024 \]
At 12:00 UTC that same day corresponds to:
\[ \mathrm{JD} = 2460483, \qquad \mathrm{MJD} = 2460483 - 2400000.5 = 60482.5 \]
Result: 2024-173 is Friday, 21 June 2024 — day 173 of 366, with 193 days remaining in the year. At 12:00 UTC it equals JD 2460483 and MJD 60482.5.
How to use the calculator
- Open the Conversion Mode dropdown and pick the direction you need: ordinal date to calendar date, calendar date to ordinal date, date and UTC time to JD/MJD, or JD back to a date and time. Only the input fields used by the selected mode are shown.
- For the ordinal-date modes, type the code into Ordinal Date or read the result under Ordinal Date (YYYY-DDD) and Ordinal Date (YYDDD). Accepted input formats are YYYYDDD (7 digits), YYDDD (5 digits) and YYYY-DDD.
- For the JD modes, set the Date and Time (UTC) fields, or enter a number into Julian Date (JD). Remember that the Julian day starts at noon UTC, so 12:00 UTC gives a whole-number JD.
- Read the results: Calendar Date with weekday, Day of Year, Julian Date (JD), Modified Julian Date (MJD) or Date and Time (UTC) from JD. A live line above the results always shows today's ordinal and Julian dates, and the day-of-year table beneath lists the cumulative day numbers of the current year.
What is a Julian date?
The term covers two different conventions, and this converter handles both. In manufacturing, logistics and the military, a Julian date (more precisely an ordinal date) is the year followed by the day number within that year: 2024-173 means the 173rd day of 2024. ISO 8601 defines this format, and the compact YYDDD form (24173) is widespread on food packaging for lot and sell-by dating, so a quick conversion to a readable calendar date is often needed.
In astronomy and other sciences that handle long time spans, the Julian date (JD) is a continuous count of days and fractions of days since noon UTC on 1 January 4713 BC. Being a single number that never resets, it makes date arithmetic trivial: subtracting two JDs gives the elapsed days directly. The Modified Julian Date (MJD), defined as JD minus 2400000.5, starts at midnight instead of noon and produces shorter, handier numbers — most modern catalogs and satellite systems use it.
Interpreting a result takes a little care. A whole-number JD refers to 12:00 UTC of that calendar day; a JD ending in .5 refers to midnight at the start of the day. Ordinal dates always follow Gregorian leap-year rules, so the day number of any date after 28 February shifts by one in a leap year — 21 June is day 172 in a common year but day 173 in a leap year.
Assumptions, limitations and practical tips
- Day 366 only exists in leap years. The day number runs from 001 to 366; in a common year the calculator rejects 366, because the year has only 365 days.
- Two-digit years are expanded per ISO 8601: 00 through 68 mean 2000–2068, and 69 through 99 mean 1969–1999. To avoid ambiguity, use the four-digit form.
- The Gregorian reform of 15 October 1582 is respected. JD values before 2299160.5 are interpreted with the historical Julian calendar, and weekday calculations switch automatically, so ancient dates come out correct for their era.
- UTC only. JD and MJD are defined in Universal Time; the converter does not shift for your local time zone. If your time is local, convert it first (or use our 24-hour clock converter to at least check the time format).
- Time is rounded to the nearest second when decoding a JD, so a JD with more than five decimals may differ from the displayed time by a fraction of a second.
- If you need the elapsed time between two dates instead, see the time duration calculator or the add and subtract time calculator.
Reference values
Useful anchor points for checking conversions:
| Epoch | JD (UTC) | Date and time (UTC) |
|---|---|---|
| Julian day number 0 | 0.0 | 1 January 4713 BC (Julian calendar), 12:00 |
| MJD = 0 | 2400000.5 | 17 November 1858, 00:00 |
| Gregorian reform | 2299160.5 | 15 October 1582, 00:00 |
| Unix epoch | 2440587.5 | 1 January 1970, 00:00 |
| J2000.0 (standard astronomical epoch) | 2451545.0 | 1 January 2000, 12:00 |
Frequently Asked Questions
How do I convert an ordinal date to a calendar date by hand?
Add up the lengths of the months one by one until the running total reaches your day number. Start with 31 (January), then add 28 (or 29 in a leap year), 31, 30, and so on. The month in which the cumulative total first equals or exceeds the day-of-year is your month, and the remainder is the day. For 2024-173: \(31+29+31+30+31=152\), so \(173-152=21\) — 21 June 2024.
Why does the astronomical Julian day start at noon instead of midnight?
The convention comes from 19th-century astronomy: observations were made at night, so a day change at midnight would split a single observing session across two Julian dates. Starting the day at 12:00 UTC keeps an entire night of observations on one whole JD. That is also why a whole-number JD means noon UTC while a JD ending in .5 means midnight.
Is a Julian date the same as a date in the Julian calendar?
No, and confusing the two is a common mistake. The Julian calendar is the old Roman calendar system used before the Gregorian reform of 15 October 1582. A Julian date (JD) is a continuous day count from 4713 BC, and an ordinal date (YYYY-DDD) is the year plus day-of-year format from ISO 8601 — three different things sharing the word "Julian".
How do I convert a Unix timestamp to a Julian date?
The Unix epoch (1 January 1970, 00:00 UTC) equals JD 2440587.5, so divide the Unix seconds by 86400 and add 2440587.5: \(\mathrm{JD} = \frac{\mathrm{unix\ seconds}}{86400} + 2440587.5\). For the Modified Julian Date, subtract 2400000.5 instead, since \(\mathrm{MJD} = \mathrm{JD} - 2400000.5\). A Unix timestamp of 0 therefore corresponds to MJD 40587.
What does a 5-digit date code on food packaging mean?
It is usually a YYDDD ordinal date: the first two digits are the year and the last three the day of the year. For example, 24173 means day 173 of 2024, which is 21 June 2024 — often printed as a lot or sell-by date. Some manufacturers use a full 7-digit YYYYDDD form. Be careful: Day 366 exists only in leap years, so check the year before assuming 365 days.
How many decimal places does a Julian date need for a given precision?
One whole day equals 1.0 in JD, so each decimal place refines the time: \(1/10\) of a day ≈ 2.4 hours, \(1/100\) ≈ 14.4 minutes, \(1/1000\) ≈ 86 seconds, and five decimals give a bit under one second. Most uses need only 1–5 decimals; this converter rounds decoded times to the nearest second, so JDs with more than five decimals may differ by a fraction of a second.
Can a Julian date be negative, and how are BC dates handled?
Yes. The epoch is noon UTC on 1 January 4713 BC (JD 0), so nothing before that is negative in practice — but days before the epoch would be. Astronomers use a year 0 (astronomical year numbering), so BC dates are offset by one: 1 BC is year 0, 4713 BC is year -4712. Also remember that dates before 15 October 1582 fall in the historical Julian calendar, so their weekday and month lengths differ from the Gregorian calendar.