Julian Date Formula: Convert Gregorian Dates to JD and MJD

PublishedToolJulian Date Calendar Converter

Contents
  1. 1. Gregorian Calendar → Julian Date (JD) Conversion Formula
  2. 2. Modified Julian Date (MJD) and Day of Year (DOY)
  3. 3. Uses in Computer Science
  4. Summary
  5. Frequently Asked Questions

The 12-month solar calendar we use every day (the Gregorian calendar) has a different number of days in each month and irregular leap years, which makes it awkward to measure the gap between two dates or to sort date data in a computer program. To get around this, astronomy, satellite orbit calculation, and distribution and logistics all rely heavily on Julian Date (JD), a running count of days written as a whole number plus a fraction. This post walks through the math that turns a Gregorian date into a JD, in a form you can work out by hand.


1. Gregorian Calendar → Julian Date (JD) Conversion Formula

Julian Date (JD) is a date index that starts at mean noon (12:00 UT) on January 1, 4713 BC as day 0 and accumulates from there as a decimal number.

Given a Gregorian year Y, month M, and day D (with the time of day added as a fraction of a day), here is how you calculate JD.

First, if the month is February or earlier (M ≤ 2), shift the year and month so that they are treated as months 13 and 14 of the previous year. Otherwise (M > 2), use the year and month as they are.

If M ≤ 2  →  Y' = Y - 1,  M' = M + 12
If M > 2  →  Y' = Y,      M' = M

Next, get the correction terms A and B, which apply to dates on or after the Gregorian reform date (October 15, 1582).

A = floor( Y' / 100 )
B = 2 - A + floor( A / 4 )

The final JD formula is:

JD = floor( 365.25 × (Y' + 4716) ) + floor( 30.6001 × (M' + 1) ) + D + B - 1524.5

(floor(x) is the floor symbol, meaning you drop everything below the decimal point.)

You can plug the numbers into this formula and check the result by hand, but recalculating the leap year and reform date corrections every time makes mistakes easy.

Check it with our tool. Enter a date and it runs the formula for you in real time, showing JD, MJD, and Day of Year all at once.

Julian Date Calendar Converter

Enter a Gregorian date to get the exact Julian Date (JD) and Modified Julian Date (MJD) values.


2. Modified Julian Date (MJD) and Day of Year (DOY)

① Modified Julian Date (MJD)

With plain JD, the date rolls over at noon (12:00), which gets confusing when you are working with morning and afternoon times, and the number is over 2.4 million, which is unwieldy. MJD fixes both problems: it uses midnight (00:00) as the start of the day and drops digits from the number.

MJD = JD - 2400000.5

MJD is often used as a reference constant in satellite orbit calculation and GPS time synchronization standards.

② Day of Year (DOY)

This is a running number that starts at 1 on January 1 and counts in order to 365 on December 31 (366 in a leap year). It is used for expiration dates in logistics and food distribution, and for date notation in the military.

DOY = target date - January 1 of that year + 1

For example, February 5, 2026 is 31 days in January plus 5, so it is the 36th day (DOY 036).

If you want to see one Gregorian date in all three notations — JD, MJD, and DOY — at once, it is faster to enter the date in the converter and compare the results directly than to work through the formulas by hand each time.


3. Uses in Computer Science

  1. Epoch Time: The Unix timestamp used on Unix systems (the number of seconds accumulated since 1970-01-01 00:00:00 UTC) is a separate system from JD, but it shares the same core idea: accumulate the elapsed amount since a fixed starting point as one continuous number to make date and time math simpler.
  2. Synchronizing astronomical observations: When calculating variations in Earth's rotation speed or leap seconds, a continuous index of dates and times that never breaks is useful.

Summary

  • JD is a date index that starts at 0 at noon (UT) on January 1, 4713 BC and accumulates dates as a decimal number.
  • MJD is JD minus 2400000.5; it is midnight-based with fewer digits, so it is easier for systems to handle.
  • DOY is a running number that starts at 1 on January 1 and counts which day of the year it is.
  • All three can be calculated by hand with the formulas above, but checking them in a converter is faster than verifying the leap year and reform date corrections every time.
Julian Date Calendar Converter

Enter a Gregorian date to get the exact Julian Date (JD) and Modified Julian Date (MJD) values.

Frequently Asked Questions

What exactly is a Julian Date (JD)?

It is an astronomical time scale that counts the days elapsed since noon (UT) on January 1, 4713 BC as the starting point (day 0), written as a whole number and a fraction. The key feature is that, regardless of the Gregorian system with its uneven months and years, you can calculate the interval between two dates precisely with nothing more than subtraction.

How is Modified Julian Date (MJD) different from JD?

JD values are usually over 2.4 million, which is awkward to handle, so MJD is a simplified version designed for convenience. The formula is MJD = JD - 2400000.5, and unlike JD it starts the day at midnight (00:00) instead of noon, so it fits the way we normally think about calendars.

Can I convert a JD I already have back into a Gregorian date?

Yes. Enter the JD decimal value you have in the "Julian → Calendar Date" panel on the right side of the tool, and it will convert it back and show the matching Gregorian year-month-day hour:minute:second.

Can I see the Julian Date for right now in real time?

Yes. The live banner at the top of the tool shows the current Julian Date, updated every second.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. Net Carb Calculator: Your Daily Limit by Calorie TargetSee how net carbs are figured, then set your daily net carb limit from your calorie target at 5%, 10%, or 20% carb intake.
  2. Polygon Area from Vertex Coordinates: Shoelace Formula ExplainedNo need to split the shape into triangles. Enter vertex coordinates in order, apply the shoelace formula, and get the area, even for concave shapes.
  3. Prepayment Penalty Formula: How the Fee Shrinks DailyLearn how the prepayment penalty is calculated, how it drops each day you keep the loan, and see a worked example with a 50 million won loan.
  4. Loan EMI Formula: Calculate Your Monthly PaymentWork through the EMI formula with a full example, see why each payment splits differently between principal and interest, and check your own numbers.
  5. Loan Interest Calculator: Total Interest by Repayment MethodEnter a loan amount, rate, and term to compare total interest across amortized, equal-principal, and interest-only balloon plans.
  6. Loan Refinance Comparison: The Real Interest Savings FormulaCalculate net savings from refinancing: interest saved minus prepayment fees and closing costs, with a worked example on a 100 million won loan.

Related tools