Leap Year Checker
Enter a year to see whether it is a leap year and exactly why, plus the next and previous leap years. Or list and count all the leap years between any two years.
Leap years in a range
How to use the Leap Year Checker
- Type a year, or use the − and + buttons to step through years.
- Press Check year (the answer also updates as you type).
- Read the explanation: each step of the divisibility rule is ticked or crossed.
- Enter a range under Leap years in a range and press Find leap years to list and count them.
- Copy or download the list if you need it elsewhere.
The leap year rule
In the Gregorian calendar, which almost every country uses today:
- If the year is divisible by 4, it is a leap year,
- unless it is divisible by 100, in which case it is not,
- unless it is also divisible by 400, in which case it is a leap year after all.
In code: leap = (y % 4 == 0 && y % 100 != 0) || y % 400 == 0. That gives 97 leap years in every 400 years.
| Year | ÷ 4 | ÷ 100 | ÷ 400 | Leap year? |
|---|---|---|---|---|
| 2023 | No | No | No | No |
| 2024 | Yes | No | No | Yes |
| 1900 | Yes | Yes | No | No |
| 2000 | Yes | Yes | Yes | Yes |
| 2100 | Yes | Yes | No | No |
| 2400 | Yes | Yes | Yes | Yes |
Leap years from 1900 to 2100
1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064, 2068, 2072, 2076, 2080, 2084, 2088, 2092 and 2096. Neither 1900 nor 2100 is a leap year, so there are 49 in this span.
Counting leap years with a formula
The number of Gregorian leap years from year 1 up to and including year y is
L(y) = ⌊y / 4⌋ − ⌊y / 100⌋ + ⌊y / 400⌋
and the number between years a and b (inclusive) is L(b) − L(a − 1). Example: from 1901 to 2000, L(2000) = 500 − 20 + 5 = 485 and L(1900) = 475 − 19 + 4 = 460, so there are 25 leap years, including 2000.
Why the calendar needs the century rule
Earth takes about 365.24219 days to go around the Sun (a tropical year). The Julian calendar of 45 BC added a leap day every four years, for an average of 365.25 days, which ran about 11 minutes fast each year. By the 1500s the calendar had drifted 10 days from the seasons, so Pope Gregory XIII introduced the Gregorian calendar in 1582: ten days were skipped and century years became leap years only when divisible by 400. The average year is now 365.2425 days, which will take more than 3,000 years to drift by one day.
Frequently asked questions
How do I know if a year is a leap year?
In the Gregorian calendar a year is a leap year if it is divisible by 4, except years divisible by 100, which are only leap years if they are also divisible by 400. So 2024 and 2000 are leap years, but 1900 and 2100 are not.
When is the next leap year?
The leap years after 2024 are 2028, 2032, 2036 and every fourth year until 2096. The year 2100 is not a leap year, so after 2096 the next one is 2104.
Why do we have leap years?
A solar year lasts about 365.2422 days. Adding a day every four years gives 365.25 days, which is slightly too long, so three leap days are dropped every 400 years. That makes the average Gregorian year 365.2425 days, within about 27 seconds of the solar year.
How many leap years are there between two years?
The tool counts them exactly. Up to and including year y there are ⌊y/4⌋ − ⌊y/100⌋ + ⌊y/400⌋ Gregorian leap years, so the number in a range is that value for the end year minus the value for the year before the start.
What is the Julian calendar rule?
The older Julian calendar made every year divisible by 4 a leap year, without the century exception. Catholic countries switched to the Gregorian calendar in 1582, Britain and its colonies in 1752, and other countries later, so pick Julian for older dates in those places.
Is year 0 a leap year?
There is no year 0 in the usual BC/AD numbering, so the tool starts at year 1. Astronomers who use year 0 treat it as a leap year, equal to 1 BC.