Calendar

What Is a Leap Year? The Real Reason February Sometimes Has 29 Days

Leap years exist because Earth doesn't orbit the Sun in exactly 365 days. The fix involves a surprisingly elegant set of rules dating back to Julius Caesar.

DM
Dr. Meera Iyer

Astrophysicist

5 de fevereiro de 2026·6 min de leitura

Earth's Inconvenient Orbit

Earth takes approximately 365.2422 days to orbit the Sun. That extra 0.2422 of a day — about 5 hours, 48 minutes, and 46 seconds — is the whole reason leap years exist. Without correction, the calendar would drift by about 1 day every 4 years. After a century, January would start creeping into what should be February. After 700 years, summer and winter would swap.

The fix sounds simple: add an extra day every four years. But 0.25 isn't 0.2422, and that small difference matters over centuries.

To be precise, the solar year — technically the "tropical year" — isn't even a fixed number. It's currently about 365.24219 days, and it's slowly getting shorter by about half a second per century due to gravitational interactions. But for calendar purposes, 365.2422 is close enough. The Gregorian correction handles the rest.

The Three Rules of Leap Years

The Gregorian calendar (the one on your wall) uses three nested rules:

  1. Divisible by 4? It's a leap year. (2024, 2028, 2032...)
  2. Divisible by 100? It's NOT a leap year. (1900, 2100, 2200...)
  3. Divisible by 400? It IS a leap year again. (1600, 2000, 2400...)

This gives an average year length of 365.2425 days — off from the true value by just 26 seconds per year. The calendar won't drift by a full day for about 3,236 years. Good enough.

In a 400-year cycle, there are exactly 97 leap years — not 100. You lose three to the century rule (years like 1800, 1900, 2100), and you gain none back because only one century year in four (2000, 2400) passes the divisible-by-400 test. Those 97 leap years give you exactly 146,097 days per 400-year cycle, which divides evenly by 7. That means the Gregorian calendar repeats its day-of-week pattern every 400 years. April 15, 2026 is a Wednesday? So was April 15, 1626, and so will be April 15, 2426.

Julius Caesar Started This

The Julian calendar, introduced in 46 BC, used only the first rule: a leap year every 4 years without exception. This made the average year 365.25 days — close, but that extra 0.0078 days per year accumulated to about 10 days by the 1500s. In 1582, Pope Gregory XIII fixed it by dropping those 10 days (October 4 was followed by October 15) and adding the century rules. Protestant and Orthodox countries resisted the change for decades or centuries. Greece didn't adopt the Gregorian calendar until 1923.

The rollout was chaotic. Catholic countries like Spain, Portugal, and Italy switched immediately in 1582. France followed in December of that year. But Protestant England held out until 1752 — by which point the drift had grown to 11 days. The British calendar skipped September 2 through September 14, 1752. Legend has it that mobs rioted chanting "give us back our eleven days," though historians debate whether that actually happened. What definitely did happen: people's rent was due on the same date but covered fewer days, and landlords pocketed the difference.

Russia held out even longer. The Julian calendar was in use there until February 1918, when the Bolshevik government decreed the switch. By then, the gap was 13 days. This is why the "October Revolution" of 1917 actually happened in November by the Gregorian calendar — October 25 in the Julian calendar was November 7 in the Gregorian. Historians still argue about which date to cite.

Leap Day Babies

"Leaplings" — people born on February 29 — number about 5 million worldwide. Most legal systems treat their birthday as either February 28 or March 1 in non-leap years. The choice varies by jurisdiction. In the UK and Hong Kong, a leapling turns 18 on March 1. In New Zealand, it's February 28.

Software handles this inconsistently too. I've personally seen bugs where a leapling's age was calculated as negative because a date library treated Feb 29 in a non-leap year as invalid and returned a weird fallback.

The probability of being born on February 29 is roughly 1 in 1,461 (accounting for the four-year cycle), which works out to about 0.068%. Some famous leaplings include the rapper Ja Rule (born February 29, 1976) and the motivational speaker Tony Robbins (born February 29, 1960). The town of Anthony, on the Texas-New Mexico border, has declared itself the "Leap Year Capital of the World" and throws a multi-day festival every four years.

The Leap Year Bug Hall of Fame

Leap years have a long history of breaking software. The most famous case: Microsoft's Zune MP3 player froze worldwide on December 31, 2008 — the 366th day of a leap year. The device's clock driver had a loop that counted days within the year but only went up to 365, creating an infinite loop on day 366. Every Zune on the planet became a brick until the clock rolled over to January 1.

Azure had a major outage on February 29, 2012, when its guest agent generated SSL certificates with a one-year expiry starting on Feb 29. The calculated expiry of February 29, 2013 was invalid (2013 wasn't a leap year), causing certificate creation to fail and taking down a significant chunk of Azure's hosted services for hours.

Gmail's spam filter apparently had a leap year issue in 2008 that caused legitimate emails to be flagged as spam because a date-based heuristic failed on February 29. These aren't obscure corner cases from tiny shops — they're from some of the largest tech companies in the world. If Google and Microsoft get tripped up by leap years, you can too. Test your date logic with February 29 inputs. Every time.

Other Calendars, Other Leap Rules

The Gregorian calendar isn't the only system with a leap mechanism. The Hebrew calendar inserts an entire leap month (Adar II) seven times in every 19-year cycle to keep its lunar months aligned with the solar year. The Islamic calendar, being purely lunar, has no leap month — it deliberately drifts through the seasons. But it does have leap days: 11 out of every 30 years have 355 days instead of 354.

The Ethiopian calendar (still in active use in Ethiopia) uses a simple leap year rule: every fourth year, no exceptions — the same as the Julian calendar. That's because Ethiopia never adopted the Gregorian reform. Their calendar is also 7–8 years behind the Gregorian calendar, which is why Ethiopia celebrated its millennium in 2007 (Gregorian). The Iranian calendar (Solar Hijri) has arguably the most accurate leap year system: it's based on astronomical observation rather than fixed rules, and its average year length matches the tropical year more precisely than the Gregorian calendar does.

Leap Years and Software: Why Developers Should Care

If you're writing code that deals with dates, leap years are a testing blind spot. Most date bugs don't surface until February 29 — and that only happens once every four years, which means they can lurk in production for a long time before anyone notices. The classic mistake is calculating age by subtracting birth year from current year without accounting for whether the birthday has occurred yet. But leap year bugs go deeper than that.

Here's one that's bitten real systems: dividing annual revenue by 365 to get a daily rate. In a leap year, the correct divisor is 366. If you're calculating daily interest accrual on a $10 million loan, the difference between dividing by 365 and 366 is about $75 per day — roughly $27,000 over the year. Financial software uses specific "day count conventions" (like Actual/365, Actual/360, 30/360) precisely because this matters. Get the convention wrong and you're miscalculating interest on every trade.

Testing advice: always include February 29 of a leap year in your test fixtures. Test the February 28–March 1 boundary in both leap and non-leap years. Test the century rule — make sure your isLeapYear() function correctly rejects 1900 and 2100 but accepts 2000. And test what happens when you add exactly one year to February 29: most date libraries return February 28 of the following year, but if your code expects the day to be preserved, you'll get a surprise.

Upcoming Leap Years

YearLeap Year?Note
2024YesDivisible by 4
2025No
2026No
2028YesDivisible by 4
2100NoDivisible by 100 (not 400)
2400YesDivisible by 400

Frequently Asked Questions

Is 2026 a leap year?

No. 2026 is not divisible by 4, so it's a common year with 365 days. The next leap year is 2028.

What if you're born on February 29?

In non-leap years, most jurisdictions treat your legal birthday as either February 28 or March 1. It varies by country and context. For age calculations, you're considered a year older after the last day of February in non-leap years.

Why isn't 1900 a leap year?

1900 is divisible by 100 but not by 400, so the Gregorian calendar skips it. The year 2000 was a leap year because it's divisible by 400. This century-rule correction prevents the calendar from drifting by about 3 days every 400 years.

How often do leap years occur?

Roughly every 4 years, but with exceptions. In a 400-year cycle, there are exactly 97 leap years (not 100), because three century years are skipped.

When is the next leap year?

The next leap year is 2028. After that, the following leap years are 2032, 2036, and 2040. All are divisible by 4 and not by 100, so they follow the standard rule.

Why is February the shortest month?

February was originally the last month of the Roman calendar and was given the fewest days. When January and February were moved to the start of the year, February kept its short length. The extra leap day was added to February because of this historical position as the calendar's "leftover" month.

Does the leap year rule work perfectly?

Nearly. The Gregorian leap year rules produce an average year of 365.2425 days, which is off from the true solar year (365.2422 days) by about 26 seconds per year. This means the calendar won't drift by a full day for approximately 3,236 years.

Sources

  • U.S. Naval Observatory — Leap Years (aa.usno.navy.mil)
  • Meeus, Jean. Astronomical Algorithms, 2nd edition (1998)
  • Gregorian Calendar reform, Inter gravissimas papal bull (1582)

DM

Sobre o Autor

Dr. Meera Iyer

Astrophysicist

Dr. Meera Iyer completed her PhD in Astrophysics and spent eight years working on precision timekeeping and solar observation. She has published over 30 peer-reviewed papers on astronomical time measurement, contributed to navigation satell

Ler biografia completa →
Voltar ao Blog

Artigos Relacionados