In 2028, February will have 29 days instead of 28. This happens every four years, and we call it a leap year. The extra day keeps our calendar aligned with Earth's orbit around the sun. Without it, the calendar would drift by about 25 days every century, and eventually July would be in the middle of winter.

But the rules are more complex than 'every four years.' The Gregorian calendar, which most of the world uses today, has a set of exceptions that most people never encounter. Here is how leap years work, why they exist, and what happens when software does not handle February 29 correctly.

Why we need leap years

A calendar year is 365 days. But a solar year, the time it takes Earth to orbit the sun, is about 365.2422 days. That extra 0.2422 days (about 5 hours and 49 minutes) accumulates each year. After four years, the buildup is nearly a full day. Without an adjustment, the calendar would drift away from the seasons.

Julius Caesar introduced the first leap year system in 46 BCE with the Julian calendar. It added one day every four years, giving an average year length of 365.25 days. This was close, but not close enough. The Julian calendar overcorrects by about 11 minutes per year, which adds up to a full day every 128 years.

By the 16th century, the Julian calendar had drifted 10 days from the solar year. The equinoxes and solstices were falling on the wrong dates, which caused problems for determining the date of Easter. In 1582, Pope Gregory XIII introduced the Gregorian calendar to fix this drift.

The Gregorian calendar rules

The Gregorian calendar has three rules for leap years:

  • Rule 1: A year that is divisible by 4 is a leap year. (2024, 2028, 2032 are leap years.)
  • Rule 2: A year that is divisible by 100 is NOT a leap year. (1700, 1800, 1900 were not leap years.)
  • Rule 3: A year that is divisible by 400 IS a leap year. (1600 and 2000 were leap years. 2400 will be.)

The three rules give an average year length of 365.2425 days. The actual solar year is 365.2422 days. The difference is about 26 seconds per year, which means the Gregorian calendar will drift by one day every 3,300 years. Not perfect, but good enough for practical purposes.

Century years: the tricky exception

Most people will never encounter a century year that is not a leap year, because the last one was 1900 and the next one is 2100. But this exception is what makes the Gregorian calendar more accurate than the Julian calendar.

The year 2000 was a leap year because it is divisible by 400. The year 2100 will not be a leap year, even though it is divisible by 4, because it is divisible by 100 but not by 400. This means February 2100 will have only 28 days. Software that only checks 'divisible by 4' will incorrectly treat 2100 as a leap year.

The year 2400 will be a leap year again, because it is divisible by 400. This cycle of 400 years contains exactly 97 leap years and 303 common years, for a total of 146,097 days. 146,097 divided by 400 is 365.2425, the average Gregorian year length.

Upcoming leap years

  • 2028: Yes, divisible by 4. February 29 falls on a Tuesday.
  • 2032: Yes, divisible by 4. February 29 falls on a Sunday.
  • 2036: Yes, divisible by 4. February 29 falls on a Friday.
  • 2040: Yes, divisible by 4. February 29 falls on a Wednesday.
  • 2100: No, divisible by 100 but not by 400. February has only 28 days.

Leap year babies

People born on February 29 are sometimes called 'leaplings' or 'leap year babies.' In non-leap years, they typically celebrate on February 28 or March 1. Legally, the choice varies by jurisdiction. In the UK, a person born on February 29 turns 18 on March 1 in non-leap years. In the US, most states consider March 1 as the legal birthday for purposes like drinking age and voting.

As of 2026, the next February 29 is in 2028. A baby born on February 29, 2024, will celebrate their first 'real' birthday in 2028, at age 4 in calendar terms. In 2026, they are technically 2 years old but have only had one actual February 29.

How software handles leap years

Most programming languages handle leap years correctly through built-in date libraries. JavaScript's Date object, Python's datetime module, and Java's java.time package all know the Gregorian rules. But bugs still happen, usually in custom date logic.

  • The most common bug: checking only if a year is divisible by 4, without checking the century rules. This works for years 2001-2099 but fails for 2100.
  • Another common bug: hardcoding February as 28 days. This breaks every four years. Always use date libraries instead of manual calculations.
  • A subtler bug: timezone issues around February 29. If a system stores dates as Unix timestamps, the extra day shifts all subsequent timestamps by 86,400 seconds. This can cause off-by-one-day errors in date calculations.
  • Calendar APIs: Some calendar APIs do not accept February 29 as a valid date in non-leap years. If a user sets a recurring event for 'February 29 every year,' the API may reject it or silently move it to February 28.

The 2010 PlayStation 3 outage was caused by a leap year bug. On March 1, 2010 (the day after February 28 in a non-leap year), PS3 systems with internal clocks that incorrectly treated 2010 as a leap year could not connect to the PlayStation Network. The bug was in the system's date handling, not in the game software itself. Sony fixed it within a day, but it was a clear example of how leap year bugs can affect millions of devices.

Other calendar systems and leap years

The Gregorian calendar is not the only calendar with leap years. The Hebrew calendar adds a 13th month (Adar II) seven times in a 19-year cycle. The Islamic calendar is purely lunar and does not use leap days, so its months drift through the seasons. The Persian (Jalali) calendar has a more complex leap year system that is actually more accurate than the Gregorian calendar, drifting by only one day in 110,000 years.

The Chinese calendar is lunisolar and adds an extra month about every three years. The extra month is inserted according to complex rules involving solar terms, making the Chinese calendar one of the most sophisticated timekeeping systems ever developed.

Use our Date Calculator to calculate the number of days between two dates, including across leap years, and our Age Calculator to see how leap years affect age calculations.

Frequently asked questions

Is 2028 a leap year?

Yes. 2028 is divisible by 4 and not a century year, so it is a leap year. February 2028 will have 29 days, and February 29 will fall on a Tuesday.

Why do we have leap years?

A solar year is about 365.2422 days, but a calendar year is 365 days. The extra 0.2422 days accumulate, and without a leap day every four years, the calendar would drift away from the seasons by about 25 days per century.

Will 2100 be a leap year?

No. The Gregorian calendar rule says that years divisible by 100 are not leap years, unless they are also divisible by 400. Since 2100 is divisible by 100 but not by 400, it will not be a leap year. February 2100 will have only 28 days.

Was 2000 a leap year?

Yes. The year 2000 is divisible by 400, so it was a leap year despite being a century year. This is the exception to the century rule. The next century year that is a leap year will be 2400.

How do leap years affect date calculations?

Leap years add an extra day (February 29) to the calendar. This means the number of days between two dates can vary by one depending on whether a leap day falls in the range. Date calculation tools handle this automatically, but manual calculations that assume 365 days per year will be off by one day for each leap year in the range.

Related tools

Date CalculatorAge CalculatorDay of Week Calculator