How Leap Years Work: The 4/100/400 Rule and Date Math

The 4/100/400 leap-year rule, the astronomical reason behind it, and how it affects date calculations, including Feb 29 birthdays in non-leap years.

What is the leap-year rule?

A leap year follows a three-part rule: a year divisible by 4 is a leap year, except a year divisible by 100 is not, except a year divisible by 400 is a leap year after all. 2024 is divisible by 4 but not 100, so it's a leap year; 1900 is divisible by 100 but not 400, so it isn't; 2000 is divisible by 400, so it is.

Why does this three-part rule exist?

Earth's actual trip around the sun takes about 365.2422 days, so adding a leap day every 4 years (averaging 365.25 days per year) overcorrects slightly. Skipping the leap day in most century years, then reinstating it every 400 years, brings the long-run average to 365.2425 days per year -- much closer to the real astronomical value.

When is the next leap year, and the next non-leap century?

Leap years arrive every 4 years -- 2024, 2028, 2032, and so on. Century years that fail the leap test because they're divisible by 100 but not 400 are less common: the nearest examples are 1900 and 2100, with 2000 standing out as the exception that stayed a leap year because it's also divisible by 400.

How leap years affect date calculations

When counting the days between two dates, a range that includes February 29 needs one extra day counted compared with a range spanning only non-leap years. Hard-coding "February always has 28 days" in a manual calculation or a script is a classic source of an off-by-one bug that only shows up when the range crosses a leap year.

When does someone born on Feb 29 age in a non-leap year?

Japan's Age Counting Act sets the moment of aging at the end of the day before the birthday. Since February 29 doesn't exist in a non-leap year, someone born on that date is generally treated as aging at the end of February 28 -- the instant March 1 begins. This interpretation is also used in administrative contexts like driver's license renewals.

A common misconception about leap years

A frequent mix-up is remembering only "a year divisible by 100 isn't a leap year" and forgetting the divisible-by-400 exception. Another is assuming the extra day gets added at the end of December; it's actually added at the end of February, as February 29.

Frequently asked questions

Was 2000 a leap year?

Yes. Years divisible by 400 are exempted from the divisible-by-100 exclusion, making them leap years again.

Was 1900 a leap year?

No. It's divisible by 100 but not by 400.

When does someone born on February 29 age in a non-leap year?

Generally at the end of February 28 -- the moment March 1 begins.

Related tools