📅 Gregorian ⇄ Julian Converter

Convert between Gregorian calendar dates, Julian calendar dates (civil/historical), and Julian Day Numbers (JD) used in astronomy. Includes time-of-day support for JD fractional days and worked examples.

Converter Tool

Notes: - Julian calendar dates follow the old pre-Gregorian civil calendar (leap year every 4 years). - Julian Day Number (JD) is a continuous day count used by astronomers; by convention JD changes at noon UT — JD integer values start at noon. This tool reports JD in the conventional astronomical sense and provides fractional JD for time-of-day.

Result:

-

Introduction — two different "Julian" concepts

When people say "Julian date" they may mean two distinct things. One is the Julian calendar, the civil calendar introduced by Julius Caesar in 45 BC and used (with local variations) in Europe until the Gregorian reform began in 1582. The other is the Julian Day Number (JD)

Part I — The Julian calendar vs the Gregorian calendar

The Julian calendar was a major improvement when introduced: it standardized a 365-day year with an extra day (leap day) every fourth year. That rule — adding a leap day every year divisible by four — is simple and easy to implement. But the Julian year of 365.25 days is slightly longer than the tropical (solar) year (~365.2422 days). Over centuries this fractional difference accumulates, causing important dates like the vernal equinox to drift earlier in the calendar.

By the 16th century that drift had grown to about ten days. To fix this, Pope Gregory XIII promulgated the Gregorian reform in 1582. The reform made two important changes: (1) it skipped ten days to realign the calendar with the seasons (Thursday 4 October 1582 in many countries was followed by Friday 15 October 1582), and (2) it refined the leap-year rule: years divisible by 4 are leap years, except years divisible by 100 are not leap years unless they are divisible by 400. This correction reduced long-term drift dramatically.

Importantly, the Gregorian reform was adopted at different times in different countries. Catholic countries adopted it quickly in 1582, but other countries changed later (for example, Great Britain and its colonies in 1752; Russia only in 1918). That means historical dates around the 16th–18th centuries must be interpreted with care: some records use Julian calendar dates (the "Old Style") while modern references use Gregorian dates ("New Style").

Leap year rules: quick summary

  • Julian calendar: Every year divisible by 4 is a leap year (simple).
  • Gregorian calendar: Every year divisible by 4 is a leap year, except years divisible by 100 are not, unless they are divisible by 400. So 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not.

Why the difference grows over time

The Julian calendar adds a leap day every 4 years, giving an average year length of exactly 365.25 days. The Gregorian rule yields an average year of 365.2425 days. The difference — about 0.0075 days per year — accumulates at roughly 1 day every 128 years. That's why the gap widened from 10 days in 1582 to 13 days by the 20th century, and will reach 14 days in the 2100s because 2100 is not a Gregorian leap year.

Practical implication — civil conversions

When converting a modern Gregorian date (like 2025-09-22) to the corresponding Julian calendar date, you subtract the current difference in days (which depends on the century) to get the "Old Style" date: e.g., in the 21st century Gregorian dates are typically 13 days ahead of their Julian-counterparts (until 2100 when difference increases to 14 days). But rather than relying on a fixed table, robust conversion uses the underlying day counts and leap rules — which is what the algorithms in the converter do.

Part II — Julian Day Number (astronomical)

The Julian Day Number (JDN) and the Julian Date (JD) are tools astronomers use to simplify time calculations. Joseph Scaliger introduced the continuous counting system in the late 16th century so that astronomers could compute intervals between events without worrying about calendar names, month lengths, or leap-day irregularities. JDN is the integer assigned to a whole day, and JD is a continuous count that includes fractional days to represent time-of-day. Conventionally, astronomical JD changes at noon UTC, so the integer JDN corresponds to the day that begins at noon.

Why noon? Historically astronomers observed at night and found that assigning the date to the midday made algebra with observations simpler. Today it is a convention, and you must be aware of it when interpreting JD values: a JD with .0 typically corresponds to noon on that Julian Day, while .5 corresponds to midnight UTC at the start of the civil date.

Common variants

  • JDN (Julian Day Number) — integer count of days starting at noon UT on 4713 BC Jan 1 (Julian proleptic calendar).
  • JD (Julian Date) — includes fractional part for time-of-day (e.g., 2451545.0 = 2000-01-01 12:00:00 UTC).
  • MJD (Modified Julian Date) — MJD = JD − 2400000.5, a convenient shorter number that starts at midnight rather than noon (used in some data systems).

Why use JDN/JD?

Astronomers and other scientists value JD because it removes ambiguity. Rather than saying "January 1st, 2000, 13:00 UTC", they can write "JD 2451545.041666..." and work numerically across centuries without calendar arithmetic. It simplifies computing differences, interpolating ephemerides, and comparing observations from instruments across the globe.

Algorithms — how conversions are done (programmer-friendly)

A precise conversion relies on algorithms that convert calendar dates to a day count (JDN) and back. The converter on this page implements the well-known Fliegel–Van Flandern algorithm for Gregorian dates and related formulas for Julian calendar dates. These are deterministic, integer-based algorithms that avoid floating-point rounding errors for the date portion.

Gregorian date → JDN (standard algorithm)


a = Math.floor((14 - month) / 12)
y = year + 4800 - a
m = month + 12*a - 3
JDN = day + Math.floor((153*m + 2)/5) + 365*y + Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400) - 32045

This JDN is the integer Julian Day Number for the Gregorian calendar date at 0h UTC; to get the astronomical Julian Date (JD) including a specific time-of-day (hours, minutes, seconds), compute:


JD = JDN + (hour - 12)/24 + minute/1440 + second/86400

Note that because JD conventionally starts at noon, a time of 0:00 UTC corresponds to JD = JDN - 0.5 (midnight is half a day before noon).

Julian calendar date → JDN

For the Julian calendar (old civil calendar), the formula is almost identical but omits the Gregorian century corrections:


a = Math.floor((14 - month) / 12)
y = year + 4800 - a
m = month + 12*a - 3
JDN = day + Math.floor((153*m + 2)/5) + 365*y + Math.floor(y/4) - 32083

That -32083 constant differs from the Gregorian -32045 and accounts for the different leap-year rule.

JDN → Gregorian date (reverse algorithm)


let a = JDN + 32044
let b = Math.floor((4*a + 3)/146097)
let c = a - Math.floor(146097*b/4)
let d = Math.floor((4*c + 3)/1461)
let e = c - Math.floor(1461*d/4)
let m = Math.floor((5*e + 2)/153)
day = e - Math.floor((153*m + 2)/5) + 1
month = m + 3 - 12*Math.floor(m/10)
year = b*100 + d - 4800 + Math.floor(m/10)

For time-of-day from JD, take fractional part: frac = JD + 0.5 - Math.floor(JD + 0.5); hours = frac * 24 etc.

Worked examples — how the math looks in practice

Example 1: Gregorian → Julian calendar (historical puzzle)

Consider the day 4 October 1582 (Gregorian). This is exactly the last day before the Gregorian reform skipped days. Many Catholic countries advanced the date to 15 October 1582 the next day. But what would the Julian calendar date have been for 4 October 1582? Using the algorithms above:

  1. Compute JDN for Gregorian 1582-10-04 → (algorithm yields) JDN = 2299160.
  2. Convert that JDN to the Julian calendar using the JDN→Julian formula (subtracting appropriate offsets) → Julian calendar date = 24 September 1582.

So 4 October 1582 (Gregorian) corresponds to 24 September 1582 on the Julian civil calendar in regions that had not adopted the reform.

Example 2: Gregorian → JD (astronomical)

Convert 2000-01-01 12:00:00 UTC to JD. This is a famous anchor: JD 2451545.0. Running the Gregorian→JDN algorithm for 2000-01-01 yields JDN = 2451545. Since the time is 12:00 UT, JD = 2451545.0 exactly.

Example 3: JD → Gregorian date/time

JD = 2451545.0 → convert back to Gregorian: you get 2000-01-01 12:00:00 UTC. If you had JD = 2451545.5, that would be 2000-01-02 00:00:00 UTC (midnight), because .5 moves from noon to midnight.

Example 4: Modern civil conversion

Convert 25 December 2025 (Gregorian) to the Julian calendar date used historically: compute JDN for 2025-12-25, then compute the corresponding Julian calendar components — in the 21st century the difference is 13 days, so the Julian calendar date will be 12 December 2025 (Julian). The converter produces this precisely, using the underlying integer algorithms rather than a fixed offset table.

Applications — where each system is used

  • Historians and archivists: converting dates in documents from countries that adopted the Gregorian calendar at different times. Accurate conversion makes it possible to align events in different places on the same absolute timeline.
  • Astronomers: JD is the lingua franca for timestamps of observations and ephemerides. JD simplifies interpolation, time differences, and cross-instrument comparisons.
  • Software & databases: JDN/JD are sometimes used internally for date arithmetic when you want independence from calendar peculiarities. Julian calendar conversions are also needed in genealogy software to interpret old records correctly.

Edge cases and important caveats

There are a few pitfalls to keep in mind:

  • Adoption differences: the Gregorian reform was not simultaneous worldwide. When reading historic documents, check which calendar was in effect locally at the time.
  • Time-of-day and JD conventions: remember that JD conventionally starts at noon. If you want midnight-based day counts, use MJD or adjust by 0.5.
  • Proleptic calendars: when you extend the Gregorian or Julian calendar backward before they were invented, you get the proleptic Gregorian/Julian calendar. This is useful computationally but historically misleading — historical records may use different systems.
  • Negative years / astronomical year numbering: astronomical year numbering includes a year 0 (which corresponds to 1 BC in the historical system). Civil calendars do not have year 0, so careful handling is necessary for very old dates.

Reference table — quick conversions

Gregorian DateJulian Calendar DateJDN (integer)JD at 00:00 UTC
1582-10-041582-09-24 (Julian)22991602299160.5
1582-10-151582-10-05 (Julian)22991612299161.5
2000-01-01 12:002000-01-01 12:00 (Julian)24515452451545.0
2025-12-252025-12-12 (Julian)24606652460665.5
2025-09-222025-09-09 (Julian)24606202460620.5

Frequently asked questions

Q: Are Julian calendar dates still used anywhere?

A: Some religious communities (notably certain Eastern Orthodox churches) still use the Julian calendar for liturgical purposes. For everyday civil life, almost every country uses the Gregorian calendar.

Q: What exactly is the difference between JDN and JD?

A: JDN (Julian Day Number) is the integer day count. JD (Julian Date) includes fractional days to express time-of-day. JD is continuous; JDN is the integer label typically associated with noon-based days.

Q: Why do astronomers use noon-based JD rather than midnight?

A: Historically, observations spanned nights; using noon as the boundary made certain calculations and record-keeping simpler. It’s a convention that persists and is well understood in astronomical datasets.

Q: Can I convert dates before year 1 AD?

A: Yes, the algorithms handle proleptic calendars and negative years (astronomical year numbering) but be careful: historical records use non-astronomical year numbering without year 0. The converter uses mathematical rules consistent with astronomical convention; for genealogical or historical work verify the intended year numbering system.

Conclusion

Converting between Gregorian dates, Julian calendar dates, and Julian Day Numbers is a foundational skill for historians, astronomers, and software engineers who work with dates across eras and systems. The Julian calendar is a simple leap-year system that served Europe for many centuries but drifted relative to the solar year. The Gregorian reform fixed that drift and is the civil calendar in widespread use today. The Julian Day Number and Julian Date are powerful numerical representations useful for unambiguous time arithmetic and astronomical work. This page implements both calendar and JD conversions using robust integer algorithms; the examples above show how to interpret results and avoid common traps.