What this calculator does
This tool converts a calendar date between the Julian calendar (introduced 45 BC, every year divisible by 4 is a leap year) and the Gregorian calendar (the 1582 reform that drops three leap days every 400 years). Enter a date in one calendar and it returns the matching date in the other. It is a pure astronomical/Western calendar conversion and applies identically everywhere — it is not region-specific.
How to use it
Pick the source calendar (the system your entered date is written in); the result is produced in the opposite system. Choose the era (AD/CE or BC/BCE), then enter the year, month and day. The calculator reports the converted era, year, month and day, plus the intermediate Julian Day Number (JDN) and the day offset (how many days Gregorian leads Julian for that date).
The formula explained
The cleanest exact conversion routes through the JDN, an integer day count independent of any calendar. Step A converts the source (year, month, day) to a JDN using the standard integer formulas (a Julian variant and a Gregorian variant). Step B converts that JDN to the other calendar. The Gregorian-to-JDN formula is:
$$\text{JDN} = D + \left\lfloor\frac{153m+2}{5}\right\rfloor + 365y + \left\lfloor\frac{y}{4}\right\rfloor - \left\lfloor\frac{y}{100}\right\rfloor + \left\lfloor\frac{y}{400}\right\rfloor - 32045$$
and the Julian variant is:
$$\text{JDN} = D + \left\lfloor\frac{153m+2}{5}\right\rfloor + 365y + \left\lfloor\frac{y}{4}\right\rfloor - 32083$$
All divisions are mathematical floor divisions, and BC years use astronomical numbering: an astronomical year of 1 - B for a BC year B (1 BC = 0, 45 BC = -44), so round-tripping through year 0 is exact.
Worked example
Gregorian AD 1582-06-15. With Yastro = 1582, the Gregorian-to-JDN formula gives \(\text{JDN} = 2299039\). Converting that JDN to Julian yields 1582-06-05. So Gregorian 15 June 1582 equals Julian 5 June 1582 — the Gregorian calendar was 10 days ahead of the Julian then, matching the October 1582 reform (\(\text{dayDifference} = +10\)).
FAQ
Is there a year 0? No. In the era system 1 BC is followed directly by AD 1. Internally we use astronomical numbering where year 0 = 1 BC, which makes the math continuous.
Why "proleptic"? These conversions apply each calendar's rules to all dates, even before that calendar existed historically. They do not model the fact that different countries adopted the Gregorian reform at different times.
How large is the offset over time? Roughly 0 days near year 200, +10 days in 1582, +13 days for 1900–2099, and +14 days from 2100 onward.