Skip to content
← All articles

Leap years

February 29 — the extra day added every 4 years to keep the calendar true.

Leap Years Explained: The Rule, the Exceptions, and Why February Gets a 29th Day

A leap year adds February 29 to keep the calendar aligned with Earth's orbit. Here is the exact rule, why 1900 was not a leap year, and how leap years affect date math.

By Shinji Furuya, Senior Frontend Engineer 7 min read

Every four years, February gets a 29th day and the calendar stretches to 366 days. Most people know the “every four years” part. Fewer know the two exceptions that make the rule actually work — the reason the year 1900 was not a leap year, but the year 2000 was.

Here is the full rule, the astronomy behind it, and how leap years quietly affect any calculation that spans more than a year.

Why leap years exist

A calendar year is our attempt to match one full orbit of Earth around the Sun. The problem is that the orbit does not take a whole number of days. It takes about 365.2422 days — a value called the tropical year.

If we simply used 365 days and ignored the extra quarter-day, the calendar would drift by about one day every four years. After a century it would be off by nearly a month; after a few centuries, spring festivals would slide into winter. Leap years exist to soak up that leftover fraction and keep the calendar locked to the seasons.

The exact rule

A year is a leap year if it satisfies all of these conditions:

  1. It is divisible by 4, and
  2. It is not divisible by 100, unless
  3. It is also divisible by 400.

Put simply:

  • Divisible by 4 → leap year…
  • …but if it is divisible by 100 → not a leap year…
  • …unless it is divisible by 400 → leap year after all.

Worked examples

Year÷4?÷100?÷400?Leap year?
2024yesnoYes
2025noNo
1900yesyesnoNo
2000yesyesyesYes
2100yesyesnoNo

This is why people who lived through the year 2000 witnessed something rare: a century year that was a leap year. The next time that happens is 2400. The century years 2100, 2200, and 2300 will all be common years of 365 days.

The math behind the exceptions

Adding one day every four years assumes the orbit is exactly 365.25 days. But it is 365.2422 — slightly less. The plain “every four years” rule therefore overcorrects by about 0.0078 days per year, which adds up to roughly three extra days every 400 years.

The 100- and 400-year exceptions remove exactly three leap days every 400 years:

  • Skip the leap year in 1900, 2100, 2200, 2300 (÷100 but not ÷400).
  • Keep it in 2000 and 2400 (÷400).

That leaves 97 leap years per 400 years instead of 100, giving an average year length of 365.2425 days — accurate to within about half a minute of the true tropical year. That is close enough that the Gregorian calendar will not drift a full day for thousands of years.

Where the 365.25 figure comes from

You will often see a year defined as exactly 365.25 days. That is the Julian year, the pre-Gregorian approximation that uses the simple “every four years” rule with no exceptions. It is still widely used in astronomy and for quick conversions because, over the span of a single human lifetime, the difference from the true value is negligible.

That is the figure this site uses when it converts years to days, hours, or seconds: one year equals 365.25 days, or 31,557,600 seconds. For a precise count between two specific calendar dates — which must respect the real leap days in that range — use a date difference calculator instead of multiplying by an average.

How leap years affect date math

Leap years quietly change the answer to everyday questions:

  • Ages. Someone born on February 29 — a “leapling” — technically has a birthday only once every four years. Most calendars and our Age Calculator treat their birthday as February 28 or March 1 in common years.
  • Day counts across a February. The number of days between, say, January 1 and March 1 is 59 in a common year but 60 in a leap year. Any range that spans February 29 gains a day.
  • “One year from today.” Adding a calendar year to February 28 or 29 is genuinely ambiguous, which is why software counts by real dates rather than by adding a fixed number of days.
  • Interest and billing. Some financial conventions use a 365-day year and simply ignore the leap day; others use the actual day count. The difference is small but real over large sums.

Quick reference

  • Leap year = divisible by 4, except century years, which must be divisible by 400.
  • 2000 was a leap year; 1900 and 2100 are not.
  • The rule keeps the calendar within about half a minute per year of Earth’s true orbit.
  • Use an average (365.25 days) for rough conversions, but count real dates when leap days matter.

← Back to all articles