Date & Time Runs locally Ready to use Built-in examples No tracking

Leap Year Calculator

Enter a year to see whether it is a leap year, with the divisibility checks by 4, 100 and 400, days in February, total days, and the previous and next leap years; switch to range mode to list every leap year between two years.

Checking a leap year looks like a matter of dividing by four, but the rule has three layers: divisible by 4, and if divisible by 100 then also by 400 — which is why 2000 was a leap year and 1900 was not. Enter a year to see each divisibility test laid out, the number of days in February and in the year, and the neighbouring leap years; enter a range to list every leap year inside it.

The scope matters: this is the Gregorian rule, in force from 15 October 1582. Before that the Julian calendar inserted a leap day every four years without exception, so 1900 would be a leap year under Julian reckoning. When converting historical dates, establish which calendar is meant before applying the rule — the wrong one moves the date by days, not hours.

How to use

  1. Enter a year to test it.
  2. Read the three divisibility checks and the verdict.
  3. Check the days in February, the length of the year and the neighbouring leap years.
  4. Switch to range mode to list every leap year between two years.

How it works

The leap-year rule

The Gregorian leap rule boils down to three sentences: a year divisible by 4 is a leap-year candidate; a century year divisible by 100 is not a leap year; but a century year also divisible by 400 is leap again. Combined: "divisible by 4 and not by 100, or divisible by 400." So 2024 is leap; 1900, divisible by 100 but not 400, is common; 2000, divisible by 400, is leap.

Why the 100- and 400-year addenda exist

Earth orbits the sun in about 365.2422 days, roughly 0.2422 days (about 5 hours 49 minutes) more than 365. Compensating only with "a leap year every four years" averages 365.25 days, still slightly longer than the tropical year, accumulating about 3 extra days every 400 years. So a leap year is dropped every 100 years and restored every 400: 97 leap years per 400 years averages 365.2425 days, only about 26 seconds off the tropical year. That's "leap every 4, no leap every 100, leap again every 400."

What leap years affect

A leap year has 366 days and a 29-day February; a common year 365 days and 28 days. Anything accumulated by calendar days is affected: interest and penalties by day, project schedules, and ISO week numbers (52 weeks + 1 day in a common year, + 2 in a leap year; when the extra days fall on Thursday or later, the year has week 53). Those born on Feb 29 usually celebrate on Feb 28 or Mar 1 in common years.

Code example

JavaScript The three-tier leap year rule

function isLeap(year) {
  return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}

isLeap(2000);   // true (divisible by 400)
isLeap(1900);   // false (divisible by 100 but not by 400)
isLeap(2024);   // true (divisible by 4 and not by 100)

Python One line from the standard library

import calendar

calendar.isleap(2024)   # True

# Counting a range:
years = [y for y in range(2000, 2101) if calendar.isleap(y)]
len(years)   # 25

FAQ

Why isn't 1900 a leap year?

1900 is divisible by 4 and looks leap, but it's also divisible by 100. Under the Gregorian rule, a century year must also be divisible by 400; 1900 / 400 = 4.75, not integer, so it's common with 365 days and a 28-day February. Neighboring 2000, divisible by 400, is leap.

Is 2100 a leap year?

No. 2100 is divisible by 4 and 100 but not 400 — "no leap every 100." It's the nearest century common year after 2000 and is often mistakenly assumed to have a Feb 29 — 2100's February has only 28 days.

How many days in a leap year?

366, one more than a common year, added at the end of February as Feb 29; a common year is 365 days with a 28-day February. After judging, the result area's "February days" and "year days" show both.

Is a leap year every 4 years?

Mostly, but not entirely. Most adjacent leap years are 4 years apart, but around century years there's an 8-year gap: 1896 is leap, yet the next is 1904, because 1900 is common. A full 400-year cycle has 97 leap years, not 100.

What's the longest gap between leap years?

8 years at most. A year divisible by 4 falling on a century (like 1900, 2100) is skipped, so 1896 to 1904 and 2096 to 2104 are 8-year gaps; otherwise 4 years. The "next leap year" in the result shows which year it is.

Is a lunar leap month the same as a Gregorian leap year?

No. A Gregorian leap year adds just one day at the end of February to align the calendar year with the tropical year; a lunar leap month adds an entire month (like leap month 6) because 12 synodic months total about 354 days, about 11 short of the tropical year, so roughly every 2-3 years a leap month is inserted. Check lunar leap months with a lunar-calendar tool.

Does a leap year affect only February?

A Gregorian leap year does add just one day at the end of February; other months are unchanged — 31 days for Jan, Mar, May, Jul, Aug, Oct, Dec, and 30 for Apr, Jun, Sep, Nov. But it changes the cumulative "day of the year" — March 1 is day 61 in a leap year and day 60 otherwise, shifting any formula based on day counts.

Should interest or schedules by day account for leap years?

Yes. Anything accumulated by calendar days (interest, penalties, project schedules, holiday counts) gains a day when crossing Feb 29; products using "annual rate / 365" differ subtly depending on whether 365 or 366 is the denominator in a leap year. Confirm with this tool whether the target year is leap, then decide days and denominators.