Leap Year Calculator
Free leap year calculator. Instantly check if any year is a leap year, and find the nearest leap years before and after it, using the exact Gregorian rule.
Leap Year Calculator
Background.
This leap year calculator tells you instantly whether any given year is a leap year under the Gregorian calendar rule, plus how many days are in that year and in February specifically, and which leap years come immediately before and after it. The rule is simple to state but has two exceptions that trip up most hand-rolled implementations: a year is a leap year if it is divisible by 4, EXCEPT century years (divisible by 100) are not leap years, UNLESS they are also divisible by 400. That means 2000 was a leap year (divisible by 400) but 1900 was not (divisible by 100 but not 400), and 2100 will not be either. This calculator applies the exact rule — not an approximation — so century-year edge cases always come out correct.
The extra day exists because Earth's orbit around the sun does not divide evenly into whole days: a solar year is closer to 365.2422 days, and simply ignoring that fraction would slowly drag the calendar's seasons out of alignment with the actual astronomical seasons over the span of a few human lifetimes. The 4-year rule alone overcorrects slightly, so the calendar's designers added the 100- and 400-year exceptions to bring the average year length even closer to the true solar year, keeping calendar dates and astronomical seasons in step for many centuries at a stretch without any further manual adjustment.
What is leap year calculator?
A leap year is a calendar year containing one extra day — February 29 — inserted to keep the calendar synchronized with Earth's orbit around the sun, which takes approximately 365.2422 days rather than an even 365. The Gregorian calendar, introduced by Pope Gregory XIII in 1582, handles that fractional day with the divisible-by-4-except-century-years-except-divisible-by-400 rule, producing an average year length of 365.2425 days — within 27 seconds of the true solar year, versus the older Julian calendar's flat 'every 4 years' rule, which drifts by about 3 days every 400 years.
How to use this calculator.
- Enter any calendar year from 5 to 9999.
- Read the primary 'Is it a leap year?' answer.
- Check 'Days in this year' and 'Days in February' for the exact day counts that follow from the answer.
- Use 'Next leap year' and 'Previous leap year' to find the nearest leap years on either side without checking each year by hand.
The formula.
A year y is a leap year if y is divisible by 4 AND (y is not divisible by 100 OR y is divisible by 400). Applying this to the two classic exception cases: 1900 is divisible by 4 (475×4) and by 100, but not by 400 (1900/400 = 4.75), so it is NOT a leap year. 2000 is divisible by 4, by 100, and by 400 (2000/400 = 5 exactly), so it IS a leap year — the 400-year exception overrides the 100-year exception. The next and previous leap year are found by walking forward or backward one year at a time, testing the same rule at each step, until a match is found — the largest possible gap between two consecutive Gregorian leap years is 8 years (for example, 1896 to 1904, because 1900 is skipped), so the search always terminates quickly.
A worked example.
2026 divided by 4 is 506.5 — not a whole number — so 2026 is not a leap year (the century-year exceptions never even come into play here, since 2026 isn't divisible by 100 either). February 2026 has 28 days, and the full year has 365. Walking forward, 2027 is not divisible by 4, but 2028 is (2028/4 = 507 exactly, and 2028 is not a century year), so the next leap year is 2028. Walking backward, 2025 is not divisible by 4, but 2024 is (2024/4 = 506 exactly), so the previous leap year is 2024. Compare this to the year 2000: divisible by 4, by 100, AND by 400, so the 400-year exception applies and 2000 IS a leap year, with 366 days and a 29-day February — unlike 1900, which is divisible by 4 and by 100 but NOT by 400, and is therefore NOT a leap year despite satisfying the basic divisible-by-4 test.
Frequently asked questions.
Why isn't every year divisible by 4 a leap year?
Is the year 2000 a leap year?
Was the year 1900 a leap year?
How far apart can two leap years be?
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled