The leap year rule, and why it has three parts
How the divide by 4, skip by 100, keep by 400 rule works, where it came from, and why it keeps the calendar in step with the seasons.
The three-part rule in plain terms
The Gregorian leap year test is a short chain of divisibility checks. First, if a year divides evenly by 4 it is a candidate for being a leap year. Second, if that year also divides by 100 it is normally pushed back to a common year. Third, if it divides by 400 as well it is pulled back in and stays a leap year. Working through the checks in that order is exactly what this calculator does for every year you enter.
Why a plain every-four-years rule is not enough
A solar year is roughly 365.2422 days, so a 365 day calendar falls behind by nearly a quarter of a day annually. Adding a leap day every four years overcorrects slightly, gaining about three extra days across four centuries. Skipping the leap day in three out of every four century years removes that surplus, which is why 1700, 1800 and 1900 were common years while 2000 was not. The result keeps the spring equinox hovering around March 20 rather than sliding through the calendar.
From Julius Caesar to Pope Gregory
The Julian calendar introduced in 45 BC used the simple every-four-years leap day and slowly drifted, accumulating roughly ten days of error by the sixteenth century. In 1582 Pope Gregory XIII approved the reform that added the 100 and 400 rules and dropped ten dates to reset the calendar. Different countries adopted the change at different times, so the same historical date can appear on two calendars depending on the region. That is why projecting the modern rule onto very old years is a convention rather than a record of how people counted days then.
How accurate is the Gregorian rule
The 400 year cycle averages 365.2425 days per year, which is close to the true 365.2422 but not perfect. The small leftover means the calendar gains roughly one day every 3,000 years or so. There is no built-in correction for that tiny drift, so future timekeepers may add a further rule, but for any practical planning today the Gregorian result this tool reports is exact.