Leap Year Calculator
Type a year to see whether it has 366 days, which test decides it, and when the previous and next leap years fall. Or list every leap year between two years
Your year
Whole years from 1583 to 9999 (Gregorian calendar)
Both years are included. Whole years from 1583 to 9999, with the first year no later than the last.
Divisible by 4 and not a century year, so it is a leap year.
How to use it
- Choose Check a year to test one year, or List a range to see every leap year between two years.
- Type a year from 1583 to 9999, or use the − and + buttons to step one year at a time. “Use this year” fills in the current year.
- Read the verdict, the three divisibility tests with their remainders, the days in the year and in February, and the weekday of February 29.
- Tap the previous or next leap year to jump straight to it, or press Copy Result to paste the answer into a message.
Worked example
Take 2100. 2100 ÷ 4 leaves remainder 0, so the first test passes. 2100 ÷ 100 leaves 0, so it is a century year and the second test passes too. 2100 ÷ 400 leaves 100, so the last test fails: 2100 is not a leap year, February has 28 days and the year has 365. The previous leap year is 2096 and the next is 2104. For the range 2000–2100 the tool shows 25 leap years in 101 years, which is 101 × 365 + 25 = 36,890 days, and lists 2100 as the one century year that is skipped.
Methodology
The rule. A year is a leap year when it is divisible by 4, except that century years (divisible by 100) are leap years only when they are also divisible by 400. In code: (y % 4 = 0 and y % 100 ≠ 0) or y % 400 = 0. That is why 1900 and 2100 are common years while 2000 and 2400 are leap years. In every 400-year cycle the pattern gives 100 − 4 + 1 = 97 leap years, so a cycle holds 400 × 365 + 97 = 146,097 days, exactly 20,871 weeks, and the average year is 146,097 ÷ 400 = 365.2425 days. The tropical year, the time between two March equinoxes, is about 365.2422 days, so the calendar drifts by roughly one day in 3,000 years. The older Julian calendar added a leap day every 4 years without exception, an average of 365.25 days, which drifts about one day per 128 years; that drift led to the Gregorian reform of 1582, when October 4 was followed by October 15. To count leap years in a range, the tool uses floor(y/4) − floor(y/100) + floor(y/400), which counts the leap years up to year y, and subtracts two such counts, so it never loops through the range to count.
Sources and documentation
The rule and the 400-year cycle come from the first two entries, the Julian comparison and the 1582 reform from the Wikipedia articles (secondary sources), and the 1900 detail from Microsoft. Pages were consulted in October 2026.
- US Naval Observatory: Leap YearsThe Gregorian leap year rule and the 400-year cycle.
- Austrian Federal Office of Metrology and Surveying (BEV): the calendarLength of the Gregorian mean year compared with the tropical year.
- Wikipedia: Leap yearSecondary source: Julian and Gregorian rules and the 97-in-400 pattern.
- Wikipedia: Adoption of the Gregorian calendarSecondary source: the 1582 reform and when each country switched.
- Microsoft Learn: Excel treats 1900 as a leap yearWhy Excel counts a February 29, 1900, that never existed.
Century years: who gets February 29?
The whole rule hides in the century years. These are the results the tool gives for the century years from 1700 to 2400, with the remainder after dividing by 400 that settles each one.
| Year | Remainder of year ÷ 400 | Leap year? |
|---|---|---|
| 1700 | 100 | No |
| 1800 | 200 | No |
| 1900 | 300 | No |
| 2000 | 0 | Yes |
| 2100 | 100 | No |
| 2200 | 200 | No |
| 2300 | 300 | No |
| 2400 | 0 | Yes |
A short case. Marta was born on February 29, 2000. On February 29, 2028, she turns 28, but that is only her 7th birthday on her real birth date (2004, 2008, 2012, 2016, 2020, 2024 and 2028). Between the two dates she has lived 28 × 365 + 7 = 10,227 days, which is exactly 1,461 weeks, so both February 29, 2000 and February 29, 2028, fall on a Tuesday. Enter 2000 and 2028 in the tool to check the weekday yourself.
Frequently asked questions
Is 1900 a leap year, and what about 2100? ▼
No to both. They are century years, divisible by 100 but not by 400 (1900 leaves a remainder of 300, 2100 leaves 100), so February has 28 days. 2000 was a leap year because 2000 ÷ 400 is exactly 5, and 2400 will be too. Between 1901 and 2099 the simple “every 4 years” habit gives the right answer, which is why the exception is easy to forget.
Why do leap years exist? ▼
A year is not a whole number of days: the Earth needs about 365.2422 days to come back to the same point in the seasons. A 365-day calendar would slip against the seasons by almost a day every 4 years. Adding a day in 97 of every 400 years makes the average year 365.2425 days, close enough that the drift is about a day over thousands of years. The rule is a good compromise, not an exact fit.
When are the next leap years? ▼
From 2028 the leap years run 2028, 2032, 2036 and 2040; February 29, 2028, is a Tuesday and 2032 a Sunday. A gap of four years is normal, and the only longer gap is eight years, which happens around a skipped century year, for example from 2096 to 2104. Use the previous and next buttons in the tool to jump from one leap year to the next.
Does the calculator work for years before 1583? ▼
No. The Gregorian calendar was introduced in 1582 and countries adopted it at different times, so before that the rule would not match the calendar people actually used. The tool shows “—” outside 1583–9999 instead of a number that could mislead. For historical dates you first need to know which calendar the place used.