LazyTools Header
Julian Day Number Converter — JDN, MJD & Lilian Day Calculator | LazyTools
Astronomy & Developer Tool

Julian Day Number Converter — JDN, MJD, Lilian Day & Code Snippets

Convert any Gregorian date to Julian Day Number (JDN) — the continuous astronomical day count from 1 January 4713 BCE. The result also shows the Modified Julian Day (MJD), the Lilian Day Number and the J2000 epoch offset simultaneously. Furthermore, the Code Snippets tab provides copy-ready JDN calculation code for Python, JavaScript, SQL and Excel.

JDN + MJD + Lilian DayJ2000 epoch offsetBoth directionsCode in 4 languagesAstronomical standard

How to use the Julian Day Number Converter

1
Enter any Gregorian date
Click the date field and select any date. Furthermore, the tool defaults to today — giving the current JDN immediately without any input. The JDN counts continuously from noon on 1 January 4713 BCE and never resets.
2
Click Calculate Day Numbers
Four day numbers appear simultaneously — JDN, Modified Julian Day, Lilian Day Number and J2000 epoch days. Furthermore, each row has its own Copy button for pasting values into code, databases or scientific calculations.
3
Understand the different day number types
JDN is the astronomical standard. MJD is JDN minus 2,400,000.5 — a smaller number used in modern astronomy. Furthermore, the Lilian Day Number counts from 15 October 1582 — the day the Gregorian calendar began. J2000 counts from 1 January 2000 noon.
4
Convert a JDN back to a date
Click the JDN → Date tab. Enter any Julian Day Number — integer or fractional. Furthermore, the tool converts it back to the Gregorian date, including the day of week.
5
Copy code snippets for your project
Click the Code Snippets tab for ready-to-use JDN calculation code in Python, JavaScript, PostgreSQL and Excel. Furthermore, each snippet is copy-ready with no dependencies required.

JDN, MJD, Lilian Day — what is the difference?

All three are continuous day counts — they count days from a fixed epoch without months or years. Furthermore, they differ only in their starting point (epoch) and the size of the resulting number.

Day numberEpochValue on 1 Jan 2025Used by
JDN1 Jan 4713 BCE (Julian)2,460,676Astronomy, chronology, long-period calculations
MJD17 Nov 1858 (midnight)60,275.5Modern astronomy, satellite tracking, GPS
Lilian Day15 Oct 1582 (Gregorian reform)161,516IBM mainframes, some database systems
J20001 Jan 2000 noon (TT)−1,826.5Space mission navigation, ephemeris calculations

Why the JDN starts at noon, not midnight

Astronomers historically observed the sky at night. Furthermore, starting the day at noon meant a full night of observation fell within a single JDN — simplifying astronomical record keeping. The Julian Day Number still starts at noon UTC (or Terrestrial Time). Moreover, this is why JDN includes a ".5" offset when expressing a specific moment at midnight: 2 January 2000 midnight = JDN 2451544.5.

How the Julian Day Number is calculated

The JDN algorithm converts a Gregorian date to a day count from the Julian Period epoch. Furthermore, the algorithm handles the difference between Julian and Gregorian leap year rules automatically.

JDN = D + ⌊(153m+2)/5⌋ + 365Y + ⌊Y/4⌋ − ⌊Y/100⌋ + ⌊Y/400⌋ − 32045
a = ⌊(14 − month) / 12⌋
Y = year + 4800 − a
m = month + 12a − 3
MJD = JDN − 2,400,000.5
Lilian = JDN − 2,299,160 (JDN of 15 Oct 1582)

The Julian Period — why 4713 BCE?

Joseph Justus Scaliger chose the JDN epoch in 1583. Furthermore, he selected 1 January 4713 BCE (Julian calendar) because it is the last time three historical cycles — the 28-year solar cycle, the 19-year Metonic cycle and the 15-year Roman indiction cycle — all started simultaneously. Moreover, this date precedes all known historical records, ensuring all historical dates have positive JDN values.

Worked example: JDN for the moon landing

The Apollo 11 moon landing occurred on 20 July 1969. What is the Julian Day Number for this date?

Day number typeValue for 20 July 1969
Julian Day Number (JDN)2440423
Modified Julian Day (MJD)40422.5
Lilian Day141263
J2000 days−11122 (before J2000)
Days since moon landingUse Date Difference Calculator
JDN 2440423 for the Apollo 11 moon landing. Furthermore, calculating elapsed days between two JDNs requires only subtraction — no month or year arithmetic needed. JDN 2460859 (today) minus 2440423 = 20,436 days since the moon landing.

What is a Julian Day Number?

The Julian Day Number is a continuous count of solar days from noon on 1 January 4713 BCE. Furthermore, it is the primary time-keeping system in astronomy and chronology. The JDN never resets — it increments by exactly 1 each day.

The key advantage of a continuous day count is simplicity. Furthermore, elapsed days between any two events require only subtraction. Moreover, the JDN works equally well with Gregorian, Julian, Hijri and any calendar expressed as a JDN.

Where JDN is used in practice

Astronomy software uses JDN for planet positions, eclipse predictions and spacecraft navigation. Furthermore, the GPS system uses a week count from 6 January 1980 — a direct descendant of the JDN concept. Moreover, many database systems store dates as day offsets from a fixed epoch — functionally identical to a modern JDN.

Modified Julian Day (MJD)

The Modified Julian Day was introduced in 1957 by the Smithsonian Astrophysical Observatory. Furthermore, MJD = JDN − 2,400,000.5 — producing smaller, more computer-friendly numbers. Moreover, MJD has become the standard in satellite tracking, GPS time calculations and modern astrophysics literature.

Why Julian Day Numbers matter

Historians and archaeologists use JDN to harmonise dates across calendar systems. Furthermore, an ancient Egyptian date and a Roman date can be expressed as JDNs and compared directly. Moreover, this enables rigorous chronology that would be impossible with calendar-specific dates alone.

Database engineers use day-count representations when date arithmetic performance matters. Furthermore, SQLite stores dates as JDN-derived integers internally. Oracle's date type uses a similar epoch day count. Moreover, month-spanning calculations reduce to simple integer arithmetic when expressed as day numbers.

How the code snippets save development time

The JDN formula is not immediately obvious and is easy to implement incorrectly — particularly around the year 1900 and before the Gregorian reform. Furthermore, the code snippets provide correct, tested implementations in four languages. Moreover, copying a working JDN formula from a reference tool takes under 10 seconds versus 30 to 60 minutes of research and debugging for a new implementation.

Frequently asked questions

The tool calculates today's JDN automatically on load. Furthermore, for reference: 1 January 2025 has JDN 2,460,676 and 1 January 2026 has JDN 2,461,041. Each day increments the JDN by exactly 1. You can verify any date using the Date → JDN tab.
These are unrelated systems despite the shared name. The Julian Day Number is a continuous astronomical day count invented in 1583 by Joseph Scaliger. Furthermore, the Julian calendar is a solar calendar introduced by Julius Caesar in 46 BCE. The JDN was named "Julian" in honour of Scaliger's father, Julius Caesar Scaliger — not the Roman emperor Julius Caesar or the Julian calendar.
The Modified Julian Day (MJD) equals JDN minus 2,400,000.5. Furthermore, this shifts the epoch to 17 November 1858 midnight and produces numbers with 5-6 digits rather than 7. Modern computers handle 5-digit day numbers more efficiently in some contexts. Moreover, MJD is the standard in satellite tracking, geodesy and precision astronomy — it is used by NASA, ESA and most modern observatories.
The Lilian Day Number counts days from 15 October 1582 — the first day of the Gregorian calendar. Furthermore, it equals JDN minus 2,299,160. The Lilian Day was introduced by IBM for use in its mainframe systems. Moreover, it produces positive integers for all Gregorian calendar dates — unlike MJD which has decimal fractions due to its midnight epoch.
Yes. The day of the week from a JDN is simply: day_of_week = (JDN + 1) mod 7, where 0 = Monday, 1 = Tuesday, … 6 = Sunday. Furthermore, this works because JDN 0 (1 Jan 4713 BCE) was a Monday. The mod 7 operation gives the correct weekday for any positive integer JDN. Moreover, this is why JDN is used as the basis for weekday calculations in many date libraries.

Related Date & Time tools

Every tool on LazyTools runs in your browser. Nothing is uploaded or stored.

Julian to Gregorian Converter

Convert dates from the old Julian calendar to the Gregorian calendar. Furthermore, the 1582 reform and the lost 10 days are explained in detail.

Unix Timestamp Converter

Convert Unix timestamps to readable dates. Furthermore, batch mode and code snippets for 5 languages are included.

Excel Serial Date Converter

Convert Excel serial date numbers to Gregorian dates. Furthermore, batch mode converts 500 serial numbers at once.

Milliseconds to Date

Convert millisecond timestamps to dates. Additionally, a duration calculator shows elapsed time between two timestamps.

Date Difference Calculator

Exact gap between two dates in every unit. Additionally, milestone markers show every 100th and 1000th day.

Online Date Format Converter

Convert dates between ISO, US, EU and 12 other formats. Furthermore, batch mode converts 100 dates at once.

Rate this tool

4.6
out of 5
449 ratings
5 ★
72%
4 ★
21%
3 ★
5%
2 ★
2%
1 ★
0%
How useful was this tool?