ThisCalculator

Everyday

Sequence of Leap Years: How It Works

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

The leap year sequence repeats every 400 years: years divisible by 4 are leap years, except century years, which must be divisible by 400. So 2024, 2028, 2032, and 2036 are leap years, while 2100 will not be.

Formula

Leap year rule: a year is a leap year if it is divisible by 4, except if it is a century year (divisible by 100) then it must also be divisible by 400. In symbols:

  • Leap if (year % 4 == 0 AND year % 100 != 0) OR (year % 400 == 0).
  • Otherwise, not a leap year.

Here year is the Gregorian calendar year (a positive integer). The modulo operator (%) gives the remainder after division. For example, 2024 % 4 = 0, 2024 % 100 = 24, so it is a leap year.

Worked Example

Check the year 2024 (the default in the calculator).

  1. 2024 ÷ 4 = 506, remainder 0 → divisible by 4.
  2. 2024 ÷ 100 = 20, remainder 24 → not a century year.
  3. Since it is divisible by 4 and not a century year, 2024 is a leap year.

The calculator returns 1 (true) for 2024. The next leap year after 2024 is 2028, which the calculator also shows.

Why the 400-Year Rule Exists

The Gregorian calendar, introduced in 1582, aims to keep the calendar year aligned with the Earth’s orbit around the Sun. A tropical year is about 365.2422 days. If we added a leap day every 4 years, the average year would be 365.25 days, which is 0.0078 days too long. Over a century, that error accumulates to about 0.78 days. The 100-year rule removes 3 leap days every 400 years, giving an average year of 365.2425 days, very close to the actual value. This is why 1700, 1800, and 1900 were not leap years, but 2000 was.

How to Find the Next Leap Year

To find the next leap year after a given year, you can use the rule directly. For a year that is not a leap year, the next leap year is usually 1, 2, or 3 years ahead. For example:

  • After 2025, the next leap year is 2028 (3 years later).
  • After 2097, the next leap year is 2104 (7 years later) because 2100 is not a leap year.

In general, you can check each year sequentially: add 1 to the year, test if it is a leap year, and repeat until you find one. The maximum gap between leap years is 8 years (e.g., 2096 to 2104).

Common Misconceptions

A frequent mistake is thinking every year divisible by 4 is a leap year. That is true for most years, but century years like 1900 and 2100 are exceptions. Another misconception is that the leap year rule is the same in all calendars. The Julian calendar, used before 1582, had a simpler rule: every year divisible by 4 was a leap year, which over centuries caused a drift. The Gregorian reform fixed this by adding the 400-year rule. Also, some people confuse leap years with leap seconds, but leap seconds are added to atomic time to keep it in sync with Earth’s rotation, not to the calendar.

Leap Years in the Julian vs. Gregorian Calendar

The Julian calendar, established in 45 BC, had a leap year every 4 years without exception. This made the average year 365.25 days, which is slightly too long. By the 16th century, the calendar had drifted about 10 days relative to the seasons. The Gregorian calendar, adopted in 1582, corrected this by skipping leap years in century years not divisible by 400. Many countries adopted the Gregorian calendar at different times, so historical dates can be tricky. For example, in the British Empire, September 2, 1752 was followed by September 14, 1752, to realign the calendar.

Frequently Asked Questions

Is 2000 a leap year?

Yes, 2000 is a leap year because it is divisible by 400. Even though it is a century year, the 400-year rule makes it a leap year.

Why is 2100 not a leap year?

2100 is divisible by 100 but not by 400, so it is not a leap year. This keeps the calendar accurate over long periods.

How often does February 29 occur?

February 29 occurs in every leap year, which is every 4 years on average, but with the century exceptions, the exact pattern repeats every 400 years. In a 400-year cycle, there are 97 leap years, so February 29 happens 97 times per 400 years.

What is the next leap year after 2024?

The next leap year after 2024 is 2028. The sequence goes 2024, 2028, 2032, 2036, and so on.

Do all countries use the Gregorian calendar?

Most countries use the Gregorian calendar for civil purposes, but some also use other calendars for religious or traditional dates. The leap year rule described here applies to the Gregorian calendar.

What happens if you are born on February 29?

People born on February 29 often celebrate their birthday on February 28 or March 1 in non-leap years. Legally, many countries recognize the birthday as occurring on March 1 in non-leap years, but it varies by jurisdiction.

Related

Formula used
in y | Year | - | 2024 | 0
out is_leap | Leap year? | - | (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) ? 1 : 0 | 0
out next | Next leap year | - | y + ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) ? 0 : 4 - (y % 4) + ((y % 100 == 0 && y % 400 != 0) ? 4 : 0)) | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.