About the Leap Year Checker
This leap year checker tests any year between 1 and 9999 against the full Gregorian rule and, more usefully, explains which clause of that rule produced the answer. It shows the divisibility results for 4, 100 and 400 separately, states whether February has 28 or 29 days and whether the year runs to 365 or 366, and gives you the previous and next leap years either side. That explanation matters because the common shorthand of every four years is wrong three times in every four centuries.
How to use the Leap Year Checker
- 1
Enter a Year between 1 and 9999.
- 2
Read the verdict at the top, which names the specific clause of the rule that decided it.
- 3
Check the Details panel for the divisible-by-4, 100 and 400 results and the resulting day counts.
- 4
Note the next and previous leap years shown alongside if you need the surrounding sequence.
What people use it for
Validating a date input
Before accepting 29 February in a form you need to know whether that year has one, and getting the century exception wrong is a well-worn bug.
Planning around a 366-day year
Payroll, interest accrual and annual quotas that divide by the number of days in a year need the correct denominator, which changes in a leap year.
Checking a historical date
Confirming whether a year in a genealogical record or a historical document could have contained a 29 February helps catch transcription errors.
Writing test cases for date code
The years 1900, 2000, 2100 and 2024 make a compact test set that exercises every branch of the rule, and this tool gives you the expected answer for each.
The full Gregorian rule
A year is a leap year if it is divisible by 4, except that years divisible by 100 are not, unless they are also divisible by 400, in which case they are. Working through the exceptions: 2024 is divisible by 4 and is not a century year, so it is a leap year. 1900 is divisible by 4 but also by 100 and not by 400, so the century exception applies and it was a common year — a fact that broke a great deal of software written by people who only implemented the first clause. 2000 is divisible by 400, so the exception to the exception applies and it was a leap year, which is why so many buggy implementations survived unnoticed for decades and then failed in 2100. Over any 400-year cycle this yields exactly 97 leap years: 100 years divisible by 4, minus the four century years, plus the one divisible by 400. That gives an average year length of 365.2425 days.
Why the century exception exists
The mean tropical year — the time from one March equinox to the next — is roughly 365.2422 days. The Julian calendar, introduced in 45 BC, approximated this as 365.25 by adding a leap day every fourth year with no exceptions. The error is only about 11 minutes a year, but it accumulates to a full day every 128 years, and by the sixteenth century the calendar had drifted about ten days out of step with the seasons, pushing Easter steadily away from its intended relationship with the spring equinox. Pope Gregory XIII's reform of 1582 fixed the accumulated drift by deleting ten days outright — 4 October was followed immediately by 15 October — and prevented recurrence by dropping three leap days every four centuries. The resulting 365.2425-day average is within about 27 seconds of the tropical year, an error that takes roughly 3,200 years to accumulate to a single day. Adoption was slow: Britain and its colonies waited until 1752, and Russia until 1918.
The Julian calendar and dates before 1582
This checker applies the Gregorian rule to every year, which is what is known as the proleptic Gregorian calendar — the modern rule extended backwards to years in which nobody was using it. That is the convention ISO 8601 adopts and it is what most software does, so it is the right default for computation. It is not, however, what a historical document says. A date recorded in England in 1700 was a Julian date, and 1700 was a leap year under the Julian rule but not under the Gregorian, so the two calendars disagree about whether 29 February 1700 existed at all. Historians handle this by labelling dates Old Style or New Style, and by noting that the gap between the calendars widens over time: ten days in 1582, eleven by 1700, twelve by 1800 and thirteen by 1900. If you are converting a pre-1752 English date, remember that the legal year also began on 25 March until that year, so a January date could belong to what we would now call the following year.
Tips
- Never implement the rule as year % 4 === 0 alone; 1900 and 2100 will prove it wrong.
- The years 1900, 2000 and 2100 are the three cases every date test suite should include.
- Leap seconds are a completely separate mechanism and have nothing to do with leap years.