Everyday Math

How to Tell If a Year Is a Leap Year: The 4-100-400 Rule

Read in other languages: 한국어 · 日本語

To tell if a year is a leap year, use the 4-100-400 rule. A year is a leap year if it divides evenly by 4. Years that also divide evenly by 100 are the exception and are not leap years, unless they divide evenly by 400. That is why 2024 and 2000 were leap years, 1900 was not, and 2100 will not be.

The rule comes from the Gregorian calendar, which most of the world uses for civil dates. It keeps the average calendar year at 365.2425 days. That is very close to the length of the cycle of seasons, roughly the time from one spring equinox to the next. Below you'll see how to apply the rule in a few seconds, why each step exists, and how February 29 can throw off countdowns, anniversaries, and spreadsheet math.

If you only need the number of days between two dates, the free date calculator counts leap days for you. The rest of this guide explains what it's doing, so you can spot a wrong answer from any tool.

How to tell if a year is a leap year: the 4-100-400 rule

Run through these three checks in order and stop at the first one that gives an answer.

  1. Does the year divide evenly by 4? If not, it is a common year with 365 days. Example: 2026 ÷ 4 = 506.5, so 2026 is not a leap year.
  2. If it divides by 4, does it also divide by 100? If not, it is a leap year with 366 days. Example: 2028 ÷ 4 = 507 and 2028 ÷ 100 = 20.28, so 2028 is a leap year.
  3. If it divides by 100, does it also divide by 400? If yes, it is a leap year. If no, it is a common year. Example: 2000 ÷ 400 = 5, so 2000 was a leap year. 1900 ÷ 400 = 4.75, so 1900 was not.

A quick mental shortcut

You don't need long division. A number divides by 4 when its last two digits do. For 2032, check 32: 32 ÷ 4 = 8, so 2032 is a leap year. For 1998, check 98: 98 ÷ 4 = 24.5, so it isn't.

For century years (ending in 00), look at the first two digits instead. If they divide by 4, the year divides by 400. For 2400, 24 ÷ 4 = 6, so 2400 is a leap year. For 2100, 21 ÷ 4 = 5.25, so 2100 is not.

Leap year examples at a glance

Year ÷ 4? ÷ 100? ÷ 400? Leap year? Days
1896 Yes No — Yes 366
1900 Yes Yes No No 365
1904 Yes No — Yes 366
2000 Yes Yes Yes Yes 366
2024 Yes No — Yes 366
2026 No — — No 365
2028 Yes No — Yes 366
2100 Yes Yes No No 365
2400 Yes Yes Yes Yes 366

Because 2000 counted as a leap year, the simple "every fourth year" pattern gives the right answer for every year from 1901 through 2099. That long run explains why so many people never learn the century rule. The next time it matters is 2100.

Why 1900 wasn't a leap year but 2000 was

The calendar is trying to keep pace with the seasons. The tropical year, the cycle of seasons that roughly runs from one spring equinox to the next, is about 365.2422 days long, not a whole number. A calendar can only have whole days, so it adds an extra day now and then to keep up.

The older Julian calendar added a leap day every fourth year with no exceptions. That gives an average of 365.25 days, about 0.0078 days (roughly 11 minutes) too long each year. Eleven minutes doesn't sound like much, but it adds up to about one full day every 128 years (1 ÷ 0.0078 ≈ 128). By the 1500s the calendar had drifted about 10 days away from where the equinox had fallen centuries earlier.

The Gregorian reform of 1582 fixed this in two ways. It removed 10 days once, so October 4, 1582 was followed by October 15. It also added the century exception so the drift wouldn't come back. Some countries switched much later. Britain and its colonies changed in 1752 and skipped 11 days, so if you work with historical dates, the country matters.

Under the new rule, 1600 and 2000 kept their leap days because they divide by 400. The years 1700, 1800, and 1900 lost theirs, and so will 2100, 2200, and 2300.

How the rule averages out to 365.2425 days

You can build the 365.2425-day average one rule at a time.

  1. Start with 365 days per year.
  2. Add one day every 4 years: 1 ÷ 4 = 0.25, so the average becomes 365.25.
  3. Remove one day every 100 years: 1 ÷ 100 = 0.01, so 365.25 − 0.01 = 365.24.
  4. Add one back every 400 years: 1 ÷ 400 = 0.0025, so 365.24 + 0.0025 = 365.2425.

You can check this by counting leap years across a full 400-year cycle. There are 400 ÷ 4 = 100 years divisible by 4. Four of them are century years, and only one of those four divides by 400. That leaves 100 − 4 + 1 = 97 leap years.

The cycle's total length is 400 × 365 + 97 = 146,000 + 97 = 146,097 days. Dividing by 400 gives 146,097 ÷ 400 = 365.2425 days per year.

There's a handy side effect. 146,097 ÷ 7 = 20,871 exactly, so every 400-year cycle contains a whole number of weeks. The Gregorian calendar repeats exactly every 400 years, weekdays included. January 1, 2426 falls on the same weekday as January 1, 2026.

The leftover error is small. 365.2425 − 365.2422 = 0.0003 days, or about 26 seconds a year. That works out to roughly one day of drift every few thousand years, so no one alive needs to worry about it.

How February 29 changes day counts

A leap year adds just one day, but that day sits in late February. Any span of dates that includes February 29 grows by one day, and any span that doesn't stays the same, even if it falls in a leap year.

A countdown that crosses February 2028

Say you're counting the days from January 1 to April 1. Add up the full months in between:

  • 2027 (common year): January 31 + February 28 + March 31 = 90 days
  • 2028 (leap year): January 31 + February 29 + March 31 = 91 days

A countdown from February 1 to March 1 is 28 days in 2027 and 29 days in 2028. If you set up a "days until" counter for an event in spring 2028 and used a 28-day February in your head, you'd be off by one. A countdown calculator that works from real calendar dates won't make that mistake.

The day of the year shifts too. In a common year, March 1 is day 60. In a leap year, it's day 61, and December 31 is day 366. This shift can also change how a year's weeks fall. A leap year that starts on a Wednesday gets 53 ISO weeks (see our guide to ISO week numbers).

Which 12-month spans have 366 days

A 12-month span has 366 days only if it contains a February 29. Whether the starting year is a leap year doesn't decide it.

Span Contains Feb 29? Days
Jan 1, 2027 → Jan 1, 2028 No 365
Mar 1, 2027 → Mar 1, 2028 Yes (Feb 29, 2028) 366
Jan 1, 2028 → Jan 1, 2029 Yes (Feb 29, 2028) 366
Mar 1, 2028 → Mar 1, 2029 No 365

Note the second and last rows. A span that starts in a common year can have 366 days, and one that starts in a leap year can have 365. Always ask whether the leap day falls inside the span.

What date is one year after February 29?

There is no February 29, 2029, so "one year from February 29, 2028" doesn't have one obvious answer. Three answers are common, and each one is correct under its own rule:

  • Add 365 days: February 29, 2028 + 365 days = February 28, 2029. (March 1, 2028 to March 1, 2029 is 365 days, so February 29, 2028 to February 28, 2029 is also 365.)
  • Add 366 days: you land on March 1, 2029.
  • Add "12 months": this depends on whether the software rounds the missing date down to the end of the month or rolls it forward.

Software makes different choices here:

  • Excel's EDATE function, asked for 12 months after February 29, 2028, returns February 28, 2029, because it rounds down to the last day of the month.
  • Excel's DATE(2029, 2, 29) rolls the extra day forward and returns March 1, 2029.
  • JavaScript's Date object also rolls over, so adding one to the year of February 29 gives March 1.
  • Python's date.replace(year=2029) on February 29, 2028 doesn't guess. It raises an error.

When a deadline, subscription renewal, or anniversary starts on a leap day, decide which rule you mean and write it down. For legal questions, like the exact date someone born on February 29 reaches a legal age, the answer depends on the jurisdiction, so check the official source for your country.

Common leap-year mistakes in date math

Assuming every fourth year is a leap year

This shortcut gives the right answer for every year from 1901 to 2099, but it gets century years like 1900 and 2100 wrong. Other years outside that range, such as 1896 or 2104, are still handled correctly. The trouble is limited to years ending in 00 that don't divide by 400.

That's enough to cause real errors, though. Code or spreadsheets that use only year % 4 == 0 will put a February 29 in 2100, and every day count that crosses it will be off by one. Historical data that reaches back past 1900 has the same problem.

Excel's 1900 leap-year bug

In its default date system, Excel treats 1900 as a leap year and accepts February 29, 1900 as a real date, stored as serial number 60. Microsoft kept the error on purpose for compatibility with Lotus 1-2-3, an older spreadsheet program that had the same bug.

For dates from March 1, 1900 on, it causes no visible problem. Before that, Excel's weekdays are off by one, and any subtraction that spans the fake February 29 counts one day too many. A common test, DAY(DATE(year,3,0))=29, asks for the last day of February. It works for most years but wrongly says 1900 is a leap year. Excel also has a 1904 date system that avoids the bug. Switching an existing workbook to it shifts every date by 1,462 days, so don't change that setting casually.

Mixing up 365 and 366 in yearly calculations

Dividing an annual amount by days gives different results in different years. A $52,000 yearly figure works out to $52,000 ÷ 365 = $142.47 per day in a common year and $52,000 ÷ 366 = $142.08 in a leap year. Finance uses several day-count conventions (such as actual/365, actual/360, and actual/actual), so check the contract or the official rules rather than guessing which one applies.

The same issue shows up in time units. A common year has 365 × 86,400 = 31,536,000 seconds, while a leap year has 366 × 86,400 = 31,622,400. Systems that store dates as a count of seconds, like the ones described in our guide to Unix timestamps, handle leap years when converting back to calendar dates, not by assuming a fixed year length.

Multiplying years by 365 or 365.25

Thirty years × 365 = 10,950 days, but any real 30-year span between 1901 and 2099 contains 7 or 8 leap days. That makes the true total 10,957 or 10,958 days. Using 365.25 (30 × 365.25 = 10,957.5) gets close on average but can't tell you the exact count. For exact ages in days or contract periods, count from actual dates.

Leap-year quick reference

  • Rule: divisible by 4 → leap; divisible by 100 → not leap; divisible by 400 → leap after all.
  • Fast check: look at the last two digits; for years ending in 00, check the first two digits instead.
  • Recent and upcoming leap years: 2020, 2024, 2028, 2032, 2036.
  • Skipped century years ahead: 2100, 2200, 2300. The next century leap year is 2400.
  • Year lengths: 365 days in a common year, 366 in a leap year; 97 leap years per 400 years.
  • Spans: a 12-month span has 366 days only if it contains February 29.
  • Leap-day anniversaries: decide whether "one year later" means February 28 or March 1 before you calculate.
  • Spreadsheets: don't trust Excel dates or weekdays before March 1, 1900.
  • Yearly rates: confirm whether the divisor should be 365, 366, or another convention.

Frequently Asked Questions

When is the next leap year?

After 2024, the next leap year is 2028, followed by 2032 and 2036. Every fourth year stays a leap year until 2096. The year 2100 is skipped because it divides by 100 but not by 400.

How do I check for a leap year in a spreadsheet formula or code?

Test the full rule, not just divisibility by 4. In Excel or Google Sheets, with the year in A1: =OR(AND(MOD(A1,4)=0,MOD(A1,100)<>0),MOD(A1,400)=0). In most programming languages the same logic is (year % 4 == 0 && year % 100 != 0) || year % 400 == 0.

Is a leap second the same thing as a leap year?

No. A leap year adds a whole day so the calendar keeps pace with the seasons. A leap second is an occasional one-second adjustment to UTC (none has been added since 2016, and they are due to be phased out by 2035) that keeps clock time close to Earth's slightly irregular rotation. The two follow separate rules and have no effect on each other.

Will the Gregorian calendar ever need another correction?

Eventually, but not for a very long time. The 4-100-400 rule drifts by only about 26 seconds a year, which adds up to roughly one day over several thousand years. Extra rules, such as skipping a leap day in the year 4000, have been proposed, but none is part of the official calendar.

Why does the leap day fall in February?

February was traditionally the month where the Roman calendar made its adjustments, and the Julian and Gregorian calendars kept the extra day there. The practical result is that only date spans that include late February are affected by a leap year. Dates from January 1 to February 28 have the same day-of-year number in every year.