Date to Julian Day Converter
Convert between calendar dates and Julian Day Numbers used in astronomy, satellite tracking, and programming. Supports JD, MJD, and TJD formats.
Date to Julian Day Converter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: JDN = day + ⌊(153m+2)/5⌋ + 365y + ⌊y/4⌋ - ⌊y/100⌋ + ⌊y/400⌋ - 32045
Worked example — JD = 2440423.345 | MJD = 40422.845 | Day of week: Sunday
Formula
JDN = day + ⌊(153m+2)/5⌋ + 365y + ⌊y/4⌋ - ⌊y/100⌋ + ⌊y/400⌋ - 32045
The Julian Day Number is computed from the Gregorian calendar date by adjusting January and February as months 13-14 of the prior year, then applying the formula that accounts for leap years. The full Julian Day adds the time fraction (hour-12)/24.
Worked Examples
Example 1: Moon Landing Date to Julian Day
Problem:Convert the Apollo 11 Moon landing date, July 20, 1969, at 20:17 UT, to Julian Day.
Solution:Year = 1969, Month = 7, Day = 20, Hour = 20, Minute = 17 a = floor((14-7)/12) = 0 y = 1969 + 4800 - 0 = 6769 m = 7 + 0 - 3 = 4 JDN = 20 + floor((153*4+2)/5) + 365*6769 + floor(6769/4) - floor(6769/100) + floor(6769/400) - 32045 JDN = 2440423 JD = 2440423 + (20-12)/24 + 17/1440 = 2440423.345
Result:JD = 2440423.345 | MJD = 40422.845 | Day of week: Sunday
Example 2: Julian Day to Calendar Date
Problem:Convert Julian Day 2451545.0 (the J2000.0 standard epoch) back to a calendar date.
Solution:JD = 2451545.0 z = floor(2451545.0 + 0.5) = 2451545 alpha = floor((2451545 - 1867216.25)/36524.25) = 15 a = 2451545 + 1 + 15 - floor(15/4) = 2451558 b = 2451558 + 1524 = 2453082 c = floor((2453082-122.1)/365.25) = 6715 dd = floor(365.25*6715) = 2452653 e = floor((2453082-2452653)/30.6001) = 14 Day = 2453082 - 2452653 - floor(30.6001*14) + 0.5 = 1.5, so Day = 1 Month: e=14 is not less than 14, so Month = 14-13 = 1 Year: Month=1 is not greater than 2, so Year = 6715-4715 = 2000
Result:January 1, 2000 at 12:00 UT (noon) — the J2000.0 epoch
Frequently Asked Questions
What is a Julian Day Number (JDN)?
The Julian Day Number is a continuous count of days that has been running since the beginning of the Julian Period on January 1, 4713 BC in the proleptic Julian calendar (November 24, 4714 BC in the Gregorian calendar). It was devised by Joseph Justus Scaliger in 1583 and named after his father Julius Caesar Scaliger, not after the Julian calendar. Astronomers use JDN because it provides a single continuous number for any date, eliminating complications from varying month lengths, leap years, and calendar reforms. The Julian Day starts at noon Universal Time, so JD 2451545.0 corresponds to January 1, 2000, at 12:00 UT (noon).
What is the difference between JD, JDN, and MJD?
Julian Day (JD) is the continuous count of days and fractions since the epoch, including the time of day as a decimal fraction. Julian Day Number (JDN) is the integer part only, representing the whole day count without any time fraction. Modified Julian Day (MJD) was introduced by the Smithsonian Astrophysical Observatory in 1957 to make the numbers smaller and easier to use; MJD = JD - 2400000.5, which shifts the epoch to November 17, 1858, at midnight (not noon). The MJD starts at midnight instead of noon, which is more convenient for civil timekeeping. The Truncated Julian Day (TJD) is yet another variant defined as JD - 2440000.5, starting from May 24, 1968.
Why do astronomers use Julian Days instead of regular dates?
Astronomers use Julian Days because they provide a uniform, continuous timescale that avoids all the complications of civil calendars. Regular calendars have variable month lengths (28-31 days), leap years, different calendar systems (Julian vs. Gregorian), and historical inconsistencies like the missing days when the Gregorian calendar was adopted in 1582. Calculating the number of days between two historical dates using regular calendars requires handling all these edge cases. With Julian Days, finding the interval between any two dates is simply a subtraction. Julian Days are also essential for astronomical ephemerides, satellite tracking, and coordinating observations across different time zones and locations worldwide.
How is the Julian Day calculated from a calendar date?
The conversion from a Gregorian calendar date to Julian Day Number uses an algorithm that accounts for the varying month lengths and leap year rules. The standard formula involves adjusting the year and month so that January and February are treated as months 13 and 14 of the previous year. The core formula is: JDN = day + floor((153*m+2)/5) + 365*y + floor(y/4) - floor(y/100) + floor(y/400) - 32045, where y and m are the adjusted year and month. To get the full Julian Day with time, add (hour-12)/24 + minute/1440 + second/86400. The subtraction of 12 hours accounts for the Julian Day starting at noon rather than midnight.
What are common uses of Julian Day Numbers in programming?
In programming, Julian Day Numbers serve several practical purposes. Database systems like SQLite and Oracle use Julian Days internally for date arithmetic because simple subtraction gives the exact number of days between dates. Many satellite tracking systems (TLE format) use Julian dates for orbital element epochs. Financial applications use Julian dates for calculating day-count fractions in bond pricing. Scientific data logging often stores timestamps as Julian Days for precision and unambiguity. The Unix timestamp (seconds since January 1, 1970) can be converted to JD by the formula: JD = unix_seconds/86400 + 2440587.5. Julian Days are also used in GPS systems, where the GPS epoch (January 6, 1980) corresponds to JD 2444244.5.
How do I get the day of the week straight from a Julian Day Number?
Take JDN modulo 7. The remainder runs 0 for Monday through 6 for Sunday, because the count has never been interrupted — no leap rule or calendar reform breaks the weekly cycle. JDN 2451545, the J2000.0 epoch, leaves a remainder of 5, which is Saturday, and 1 January 2000 was indeed a Saturday. No month-length or century reasoning is needed at any point.
Why does the Julian Day roll over at noon instead of midnight?
The noon epoch keeps a single night of observing inside one integer day number, so an astronomer logging plates or exposures from dusk to dawn never crosses a date boundary mid-session. That convention is also why the hour field here is offset by (hour − 12)/24. Modified Julian Day removes it by subtracting 2400000.5 rather than a whole number, which pushes the boundary back to civil midnight.
Why must a Julian Date always be labelled with a time scale?
The number alone does not say which clock it counts. UT1 follows the Earth's actual rotation, UTC is atomic time nudged by leap seconds to stay near UT1, and Terrestrial Time is a smooth dynamical scale that currently runs about 69 seconds ahead of UTC. Planetary ephemerides take their argument in TT, so feeding them a UTC-based Julian Date introduces an error of roughly a minute in the time argument.
How much precision does a Julian Date lose in a 64-bit float?
A double carries about sixteen significant decimal digits. Since a present-day JD already spends seven of them to the left of the point, the fraction resolves only to tens of microseconds. Modified Julian Day is smaller by 2,400,000.5 and so keeps roughly two more decimal places of resolution. For high-precision work, store the integer day and the day fraction as two separate numbers rather than one.
Why does the reverse conversion branch at 2299161?
JDN 2299161 is 15 October 1582, the first day on which the Gregorian calendar was in use. Below that value the algorithm reads the result back on Julian calendar rules, where every fourth year is a leap year with no century exception. That branch is what makes the ten deleted dates of the reform disappear cleanly: JDN 2299160 converts to 4 October 1582, and the next integer jumps straight to the 15th.
References
Background & Theory
History
Reviewed for accuracy by Abdullah, Technical Content Specialist · Editorial policy
Related Calculators
🧮Date to Day Number Calculator
Convert any date to its ordinal day number within the year (1-366).
🧮Day Number Calculator
Find the day number (1-366) of any date within its year.
🧮Chinese Calendar Converter
Convert between Gregorian calendar dates and the Chinese lunar calendar.
🧮Hebrew Calendar Converter
Convert between Gregorian and Hebrew calendar dates with Jewish holiday awareness.
🧮Persian Calendar Converter
Convert between Gregorian, Hijri, and the Persian Solar Hijri (Jalali) calendar.
🧮Decimal Hours Converter
Convert between hours:minutes format and decimal hours for payroll and billing.
🧮Election Day Calculator
Find the date of US Election Day for any year using the first Tuesday after the first Monday rule.
🧮24 Hour to 12 Hour Converter
Convert any 24-hour (military) time to 12-hour AM/PM format and vice versa.