Audited ·Last updated 27 Jul 2026·1 citations·Tier 3·0 uses

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

Any calendar year from 5 to 9999. The rule is applied proleptically (extended backward and forward), regardless of when the Gregorian calendar was actually adopted historically.
Is it a leap year?
No
'Yes' if the year is divisible by 4 and (not divisible by 100, or divisible by 400); 'No' otherwise.
Days in this year
365 days
Days in February
28 days
Next leap year
2,028
Previous leap year
2,024

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.

  1. Enter any calendar year from 5 to 9999.
  2. Read the primary 'Is it a leap year?' answer.
  3. Check 'Days in this year' and 'Days in February' for the exact day counts that follow from the answer.
  4. 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.

leap = (y mod 4 = 0) ∧ (y mod 100 ≠ 0 ∨ y mod 400 = 0)

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.

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.

year2,026

Frequently asked questions.

Why isn't every year divisible by 4 a leap year?
Because a divisible-by-4 rule alone slightly overcorrects for the true length of a solar year (about 365.2422 days), adding a little too much extra time over centuries. The Gregorian calendar's century-year exception (skip leap years in years divisible by 100, except when also divisible by 400) removes 3 leap days every 400 years, bringing the average calendar year to 365.2425 days — much closer to the real solar year than the older Julian calendar's uncorrected 365.25-day average.
Is the year 2000 a leap year?
Yes. 2000 is divisible by 4, and although it is also divisible by 100 (which would normally disqualify it), it is additionally divisible by 400, which restores its leap-year status under the Gregorian rule. This is the single most commonly mishandled case in hand-written leap-year code, because it requires checking three conditions in the right order rather than just one.
Was the year 1900 a leap year?
No. 1900 is divisible by 4 and by 100, but not by 400 (1900 ÷ 400 = 4.75), so the century-year exception applies and 1900 was an ordinary 365-day year with a 28-day February.
How far apart can two leap years be?
Normally exactly 4 years, but whenever a non-leap century year (like 1900 or 2100) falls between two candidate leap years, the gap widens to 8 years — for example, 1896 to 1904, or 2096 to 2104. This calculator's next/previous leap year search accounts for that automatically.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon