A year is a leap year if it is divisible by 4, unless it is divisible by 100, in which case it must also be divisible by 400. So 2024 and 2028 are leap years, 1900 and 2100 are not, and 2000 was. Those three rules come from the Gregorian calendar, which most of the world uses today.

The three rules
- If the year is divisible by 4, it is a leap year.
- If it is also divisible by 100, it is not a leap year.
- If it is also divisible by 400, it is a leap year after all.
Run any year through them in order:
| Year | ÷ 4 | ÷ 100 | ÷ 400 | Leap year? |
|---|---|---|---|---|
| 2026 | No | No | ||
| 2028 | Yes | No | Yes | |
| 1900 | Yes | Yes | No | No |
| 2000 | Yes | Yes | Yes | Yes |
| 2100 | Yes | Yes | No | No |
Why leap years exist
The Earth takes about 365.2422 days to go through one cycle of seasons, a period called the tropical year. That's 365 days, 5 hours and about 49 minutes. A calendar of exactly 365 days falls behind by almost a quarter of a day each year, so after a century the seasons would arrive about 24 days late by the calendar.
The background is covered in the leap year article.
Adding a day every four years gives an average year of 365.25 days, which is slightly too long. Dropping three leap days every 400 years brings the average to 365.2425 days. The difference from the tropical year is then about 27 seconds a year, or one day in roughly 3,200 years.
Where the rules came from
The Julian calendar, introduced by Julius Caesar in 45 BC, used only the first rule: a leap day every fourth year. Its 365.25-day average year runs about 11 minutes long, which adds up to a day every 128 years. By the 16th century the spring equinox had drifted about ten days earlier on the calendar, which mattered to the Church because the date of Easter depends on it.
Pope Gregory XIII's reform of 1582 removed ten days to put the equinox back near March 21 and added the century rules to stop the drift. The changeover itself is covered in Julian vs Gregorian calendar.
Century years
Century years are the only ones where the extra rules come into play:
| Century year | Leap year? |
|---|---|
| 1600 | Yes |
| 1700 | No |
| 1800 | No |
| 1900 | No |
| 2000 | Yes |
| 2100 | No |
| 2200 | No |
| 2300 | No |
| 2400 | Yes |
That makes 97 leap years in every 400. Between 2001 and 2100 there are 24 leap years, from 2004 to 2096, because 2100 is skipped.

Upcoming leap years
2028, 2032, 2036, 2040, 2044 and 2048. For what happens in the next one, including the weekday of February 29, see is 2028 a leap year.
Checking a year in Excel or code
In Excel or Google Sheets, with the year in cell A1:
- =IF(OR(AND(MOD(A1,4)=0,MOD(A1,100)<>0),MOD(A1,400)=0),"Leap year","Common year")
In most programming languages the test is the same expression: the year is divisible by 4 and not by 100, or it is divisible by 400.
Excel has one known quirk: it treats 1900 as a leap year and accepts February 29, 1900 as a date. The bug was kept on purpose for compatibility with Lotus 1-2-3, so don't trust Excel's weekday calculations for dates before March 1, 1900.
Leap days vs leap seconds
A leap second is a different correction. It adjusts clock time for irregularities in the Earth's rotation and has nothing to do with the calendar. Leap days are fixed by the rules above; leap seconds were announced a few months in advance by the International Earth Rotation and Reference Systems Service.
See it on a calendar
The 2028 calendar and February 2028 show the next leap day in place. To build a printable year with the leap day marked, start from the yearly templates. And for the reason the extra day goes into February in the first place, read why February has 28 days.
Frequently asked questions
It must be divisible by 4. If it is also divisible by 100, it must be divisible by 400 as well. 2028 and 2000 are leap years; 1900 and 2100 are not.
2100 is divisible by 100 but not by 400. The Gregorian calendar skips those century leap days to keep the average year at 365.2425 days.
97. One every four years would be 100, minus the three century years not divisible by 400.