Skip to main content
CalcMax

Leap Year Calculator

Range: 5 – 9,995

Result

365 daysCommon year

Days in the year

Days in February
28 days
Next leap year
2,028
Previous leap year
2,024

Every four years, except every hundred, except every four hundred — which is why 2024 is a leap year, 1900 was not, and 2000 was. This calculator answers the question for any year from 5 to 9995, and reports the length of that year and of its February along with the nearest leap years on either side. The rule is short enough to apply by hand; the reason to use a tool is the two exceptions, and the years where they bite are exactly the ones people ask about.

Which of these years are leap years, and the rule behind each verdict

YearVerdictThe rule for that verdict
2024Leap yeardivisible by 4 and not by 100, or divisible by 400
2000Leap yeardivisible by 4 and not by 100, or divisible by 400
2026Common yearnot divisible by 4, or divisible by 100 and not by 400
1900Common yearnot divisible by 4, or divisible by 100 and not by 400
2100Common yearnot divisible by 4, or divisible by 100 and not by 400

The last column is the whole rule for that verdict, so the two leap years read alike there. Which half of it decided each row is this: 2024 and 2000 are both leap years for different reasons — the first because it is divisible by 4 and not by 100, the second because it is divisible by 400. 1900 and 2100 fail on the same clause as each other, divisible by 100 but not by 400.

Formula

leap = (year mod 4 = 0 and year mod 100 ≠ 0) or year mod 400 = 0

year
The year being tested, anywhere from 5 to 9995
daysInYear
366 if the year is a leap year, 365 otherwise
februaryDays
29 if the year is a leap year, 28 otherwise — the only month the rule touches
nextLeapYear
The nearest leap year after this one, never the year itself
previousLeapYear
The nearest leap year before this one, never the year itself

Use the calculator to settle whether a year takes a leap day, to get the length of a February before writing a schedule, or to find the next leap year for an event that recurs every four years. Nearly all the interesting cases are century years: 1900 was not a leap year, 2000 was, and 2100 will not be. Anything that applies only the divisibility-by-four rule will call all three of those leap years and be wrong about two of them.

Worked examples

  1. 2026 — an ordinary common year

    1. 2026 divided by 4 is 506.5, so the year fails the very first clause and the rest of the rule never comes into play
    2. A common year has 365 days and its February has 28 — the only month whose length the rule changes
    3. The nearest leap years are 2024 and 2028, four years either side
    4. Neither neighbour is the year itself: the two outputs are strictly before and strictly after whatever year was entered

    The ordinary case, and the one that is easy to get right.

  2. 2024 — the four-year rule alone would do

    1. 2024 divided by 4 is 506 exactly, and 2024 is not divisible by 100, so the first clause is satisfied
    2. The year therefore has 366 days and its February has 29
    3. The nearest leap years are 2020 and 2028, even though 2024 is itself a leap year
    4. The divisibility-by-400 test is never reached, because the first clause has already decided the answer

    Adding a day every four years and nothing else would gain about three days every four centuries. The two century clauses exist to remove exactly that drift.

  3. 1900 — divisible by 4, and still not a leap year

    1. 1900 divided by 4 is 475 exactly, so a rule that stopped there would call it a leap year
    2. But 1900 is divisible by 100 and not by 400, so the second clause takes the extra day back
    3. The result is a common year of 365 days with a 28-day February
    4. The nearest leap years are 1896 and 1904 — the four-year pattern is interrupted for one cycle

    This is the case every shortened version of the rule gets wrong, and it is the reason a calculator is worth more than a remembered rhyme.

Limitations

Leap years are a property of the Gregorian calendar, and the Gregorian calendar is itself an approximation: it drifts one day against the seasons roughly every 3,300 years, and no correction for that has been adopted. Years before 1582 are treated as proleptic Gregorian here, so 1500 fails the test even though it was a leap year in the Julian calendar people were using at the time. The tool tests one year at a time and does not list leap years across a range.

Frequently asked questions

Is 2024 a leap year?
Yes, because 2024 is divisible by 4 and not by 100. It has 366 days and its February has 29, and the nearest leap years are 2020 and 2028. A year divisible by four is a leap year unless one of the two century clauses removes the extra day.
Why is 1900 not a leap year?
Because it is divisible by 100 but not by 400. A rule that tested only divisibility by four would call 1900 a leap year, and it was a leap year under the Julian calendar; the Gregorian reform took the leap day away from century years unless they are also divisible by 400. 2000 kept its day for exactly that reason, and 2100 will lose it.
How many days are in February?
28 in a common year and 29 in a leap year, which makes February the only month whose length the rule changes. The other eleven are fixed at 31 or 30 days, so a year is 365 or 366 days entirely because of this one month.
What is the next leap year?
2028, since 2026 is a common year, and every year entered here reports both neighbours. The gap is four years except across a skipped century year, where it stretches to eight — 1896 to 1904 is one such gap.
Does the tool work for very old or very distant years?
It accepts years from 5 to 9995, which keeps every intermediate date within the range a JavaScript Date can represent. Below 1582 the answer is proleptic Gregorian — the rule applied backwards to a calendar that was not in use — and 9996 and beyond are refused rather than answered with a wrong number.

References

Related calculators