Leap Year Calculator

Check whether a given year is a leap year using the Gregorian 4/100/400 rule.

Time & Date 1582-9999 Rule trace
Rate this calculator · 5.0 (1)

Gregorian leap year check

4 / 100 / 400 rule · with rule trace

Instructions — Leap Year Calculator

1

Enter a year

Any year from 1582 (when the Gregorian calendar was adopted) through 9999. The calculator defaults to the current year. Use the quick-pick chips to jump to common test cases like 2000, 1900, or 2100.

2

Read the verdict

The big YES or NO shows whether the year has 366 days. The rule trace under it shows each divisibility check? divisible by 4, by 100, and by 400? so you can see which branch of the rule triggered.

3

Use the neighbors

The output grid also lists the next and previous leap year. Useful when planning a Feb 29 birthday party, an Olympic year, or a US presidential election cycle? all of which align with leap years.

Quick check: if a year is not divisible by 4 at all, you can stop? it is a common year. The 100 and 400 rules only matter for century years.
Pre-1582 years: the Gregorian calendar did not exist before 1582. Historical dates use the Julian rule (every 4 years, no exceptions). The calculator restricts input to Gregorian years.

Formulas

The Gregorian leap year rule is a three-step divisibility test. Each step has a single answer; once you reach a YES or NO, you stop.

The Gregorian Rule (full form)
$$ \text{leap}(y) = (y \bmod 400 = 0) \;\text{or}\; \bigl((y \bmod 4 = 0) \;\text{and}\; (y \bmod 100 \neq 0)\bigr) $$
Two ways a year can be a leap year: it is divisible by 400, OR it is divisible by 4 but not by 100.
Three-step decision
$$ \text{If } y \bmod 400 = 0 \to \text{leap. Else if } y \bmod 100 = 0 \to \text{not leap. Else if } y \bmod 4 = 0 \to \text{leap. Else } \to \text{not leap.} $$
The order matters: check 400 first, then 100, then 4. This is how most programming languages implement it.
Days in a year
$$ \text{days}(y) = \begin{cases} 366 & \text{if leap}(y) \\ 365 & \text{otherwise} \end{cases} $$
A leap year has 366 days because February has 29 days instead of 28. The extra day keeps the calendar aligned with the solar year.
Average Gregorian year length
$$ \bar{Y} = 365 + \tfrac{1}{4} - \tfrac{1}{100} + \tfrac{1}{400} = 365.2425 \text{ days} $$
The mean Gregorian year is 365.2425 days, compared with the tropical year of 365.24219 days. The drift is about 26 seconds per year, or one day every 3,236 years.
Leap years in any 400-year cycle
$$ 100 - 4 + 1 = 97 \text{ leap years per 400 years} $$
100 years divisible by 4, minus 4 century years not divisible by 400, plus 1 century year that is divisible by 400. The pattern repeats exactly every 400 years.
Julian rule (pre-1582 history)
$$ \text{leap}_\text{Julian}(y) = (y \bmod 4 = 0) $$
The older Julian calendar treated every fourth year as a leap year? no exceptions. That extra ~11 minutes per year added up to 10 lost days by 1582.

Reference

Century years and the 400 rule
Year÷ 4÷ 100÷ 400Leap?
1600yesyesyesYes
1700yesyesnoNo
1800yesyesnoNo
1900yesyesnoNo
2000yesyesyesYes
2100yesyesnoNo
2400yesyesyesYes

Recent and upcoming leap years

Each leap year, February gets a 29th day. The cycle is every four years, with century-year exceptions.

Past leap years
YearNote
2000divisible by 400
2004Athens Olympics
2008Beijing Olympics
2012London Olympics
2016Rio Olympics
2020Tokyo Olympics
2024Paris Olympics
Upcoming leap years
YearNote
2028LA Olympics, US election
2032Brisbane Olympics
2036standard 4-year leap
2040standard 4-year leap
2096last leap of the 21st century
2100not a leap year
2104next after the 2100 skip

2100 is a famous trick year: it is divisible by 4 and by 100, but not by 400, so it is not a leap year. The same is true of 2200 and 2300. The next century leap year after 2000 is 2400.

Article — Leap Year Calculator

Leap Year Calculator

A leap year is any year with 366 days instead of the usual 365. Under the Gregorian calendar in use since 1582, a year is a leap year if it is divisible by 4, except century years are not leap years, except century years divisible by 400 are leap years. So 2024 yes, 1900 no, 2000 yes.

The rule lives in three short steps. The first two cover the common case, where every fourth year gets an extra day. The third pulls the calendar back in line every 400 years, smoothing out a tiny excess that would otherwise drift the seasons. Most people remember the four-year part. The 100 and 400 parts trip up even careful spreadsheet authors.

What is a leap year?

A leap year has 366 days. The extra day is February 29, sometimes called leap day. A common year has 365 days, with February ending on the 28th. The calendar adds a leap day so the average length of the year stays close to one full orbit of Earth around the Sun, which takes about 365.2422 days.

The current leap year rule comes from the Gregorian calendar, introduced by Pope Gregory XIII in October 1582. It replaced the Julian calendar, which had been in use since 45 BC. The Gregorian rule keeps the calendar accurate to within a single day every 3,236 years, which is good enough that astronomers and timekeepers have not needed to revise it.

Did you know

The Gregorian calendar reform skipped 10 days in 1582 to correct accumulated Julian drift. In Catholic countries, October 4 was followed directly by October 15. Protestant countries held out for centuries — Britain and its colonies waited until 1752, when they skipped 11 days at once. The American records of George Washington show two birthdays: Feb 11 (Old Style) and Feb 22 (New Style).

The 4 / 100 / 400 leap year rule

The leap year rule is a three-step check. The first answer you find is the final answer.

  • Step 1 — if the year is divisible by 400, it is a leap year. Stop.
  • Step 2 — if the year is divisible by 100 (but not 400), it is not a leap year. Stop.
  • Step 3 — if the year is divisible by 4 (and not 100), it is a leap year. Stop.
  • Otherwise — it is a common year with 365 days.

Applied to recent years: 2020 passes step 3 (divisible by 4, not 100). 2024 passes step 3 the same way. 2025 fails all three. 2000 passes step 1 — the rare case where the 400-year override matters. 1900 hits step 2 and ends as a common year, which surprises people who remember the four-year cycle but not the century exception.

Quick checks for the current century
2024 leap (4: yes, 100: no)
2025 common (4: no)
2028 leap (4: yes, 100: no)
2100 common (4: yes, 100: yes, 400: no)
2400 leap (4: yes, 100: yes, 400: yes)

The century year trap

Century years are the part of the rule most people get wrong. The simple cycle of every four years suggests 1700, 1800, and 1900 should all be leap years. They were not. None of them passed step 1 of the rule, because none are divisible by 400.

Year 2000 was the surprise winner of the modern era. It was the first century year in 400 years to pass step 1, having last happened in 1600. The next will be 2400. Most people alive today have never lived through a non-leap century year — 2100 will be the first, and it is still a long way off.

The 1900 trap in spreadsheets

Microsoft Excel and Lotus 1-2-3 both treat 1900 as a leap year for compatibility reasons. The bug came from Lotus and was carried over to maintain serial-date interoperability. If you build date math with Excel's date serial numbers, a date in 1900 may shift by one day compared to a correctly written calendar library.

Why we need leap years at all

The tropical year — one full cycle of seasons — is 365.2422 days. If every calendar year had exactly 365 days, the seasons would drift by a quarter of a day per year, putting them off by 97 days after four centuries.

Julius Caesar tried to fix this in 45 BC with the Julian calendar, which added one leap year every four years. That gives an average of 365.25 days, close but still 11 minutes too long. By 1582, the Julian calendar had drifted 10 days behind the seasons, prompting the Gregorian reform.

Julian vs Gregorian leap years

The Julian rule is simple: any year divisible by 4 is a leap year, with no exceptions. The Gregorian rule adds the 100 and 400 corrections. The two disagree for 3 of every 400 years — the century years not divisible by 400. Astronomers and historians still use the Julian system for ancient dates, and Eastern Orthodox churches use a revised Julian calendar for liturgy.

Julian
365.2500 days
11 min too long per year
Gregorian
365.2425 days
26 seconds too long per year

Famous calendar software bugs

Date handling is a common source of bugs, almost always caused by code that assumes every fourth year is a leap year (or every year ending in 00 is not) without checking the full rule.

In 2008, Microsoft Zune media players froze on December 31 because of a leap-year loop that did not exit on the 366th day. In 2012, Microsoft Azure had a six-hour outage from a certificate calculation that appended February 29 to a non-leap year. In 2024, several Asian transit ticket-printing systems rejected leap-day timestamps for hours.

Tip

If you write date code, use a tested library. ICU, java.time,.NET DateOnly, Python's datetime, JavaScript's Temporal, and Go's time package all handle leap years correctly. Hand-rolled mod-4 checks miss the 100 / 400 corrections more often than not.

Leap year cycles, Olympics, and US elections

Summer Olympic years and US presidential election years tend to land on leap years because both follow four-year cycles synchronized to them. Every Summer Olympics from 1896 to 2024 (excluding 1900 and the World War II cancellations) and every US presidential election since 1788 has fallen on a leap year. The cycle will visibly skip at the next non-leap century year, which is 2100.

Leaplings born on February 29

People born on February 29 are sometimes called leaplings or leapers. Their birth dates fall on a real calendar day only once every four years. About 1 in 1,461 people are leaplings — close to 5 million worldwide, and about 226,000 in the United States.

Most jurisdictions treat a leapling's legal birthday as March 1 in common years, since this is the next day that exists. Driving age, voting age, and drinking age all use this rule. New Zealand and Taiwan use February 28 instead. Sweden and Finland recognize February 29 as the legal birthday and simply skip the celebration in common years.

Did you know

Famous leaplings include rapper Ja Rule (1976), motivational speaker Tony Robbins (1960), and Pope Paul III (1468). The town of Anthony, Texas, calls itself the "Leap Year Capital of the World" and has hosted a Leap Year Festival every leap year since 1988.

FAQ

No. 2026 is not divisible by 4 (2026 ÷ 4 = 506.5), so it is a common year with 365 days. The next leap year after 2026 is 2028.
Yes. 2024 is divisible by 4 (506 × 4 = 2024) and is not a century year, so the simple rule applies. February 2024 had 29 days.
Yes. 2000 is divisible by 400, so it is a leap year even though it is a century year. This is the case that surprises people? they remember the 100-year exception but forget the 400-year override.
No. 1900 is divisible by 4 and by 100, but not by 400. The 100-rule applies, so it was a common year with 365 days. This trips up older spreadsheets, and Microsoft Excel still simulates a 1900 leap year for compatibility with Lotus 1-2-3.
No. 2100 is divisible by 4 and by 100, but not by 400 (2100 ÷ 400 = 5.25). So February 2100 will have 28 days, breaking the four-year pattern people are used to.
Exactly 97. The math: 400 ÷ 4 = 100 candidates, minus 4 century years (1700-style) that fail the 100 rule, plus 1 century year (2000-style) that passes the 400 rule. 100 − 4 + 1 = 97.
Because the tropical year — one full orbit of Earth around the Sun — is about 365.2422 days, not exactly 365. Adding one extra day every four years (with corrections for century years) keeps the calendar from drifting away from the seasons.
It is the Gregorian leap year rule. A year is a leap year if it is divisible by 4, EXCEPT century years are not leap years, EXCEPT century years divisible by 400 ARE leap years. So 2000 (yes), 1900 (no), 2024 (yes), 2025 (no).
The Julian calendar (45 BC to 1582 AD) treated every fourth year as a leap year with no exceptions, giving an average year length of 365.25 days. The Gregorian reform of 1582 added the 100 and 400 exceptions, reducing the average to 365.2425 days and matching the solar year far more closely.
Yes. About 1 in 1,461 people are born on February 29. They are sometimes called leaplings or leapers. They typically celebrate their birthday on Feb 28 or March 1 in common years. Famous leaplings include rapper Ja Rule and motivational speaker Tony Robbins.