Check whether a year is a leap year.
isLeapYear = (Y mod 4 == 0) AND ((Y mod 100 != 0) OR (Y mod 400 == 0))
Under the Gregorian calendar (adopted in 1582 and now used worldwide), a year is a leap year if it satisfies a precise three-part divisibility rule. The rule accounts for the fact that a solar year is approximately 365.2422 days long — not exactly 365 days. Without correction, our calendar would drift about one day every four years.
The rule is applied in order:
This logic can be expressed as a single boolean condition.
Step 1: 2000 mod 4 = 0 ✓ (divisible by 4) Step 2: 2000 mod 100 = 0 ✗ (divisible by 100 — normally disqualified) Step 3: 2000 mod 400 = 0 ✓ (divisible by 400 — exception applies) Result: (0 == 0) AND ((0 != 0) OR (0 == 0)) = TRUE AND (FALSE OR TRUE) = TRUE AND TRUE = TRUE
Result: 2000 IS a leap year (366 days).
The year 2000 is a leap year because it passes the critical 400-year exception. Even though it is divisible by 100 (which would normally exclude it), it is also divisible by 400, which overrides that exclusion. By contrast, the year 1900 is not a leap year — it is divisible by 100 but not by 400. And 2024 IS a leap year simply because it is divisible by 4 and not by 100.
The Earth takes approximately 365.2422 days to complete one orbit around the Sun — the tropical year. A standard calendar year of 365 days falls short by roughly 0.2422 days each year. Without correction, after about 100 years the calendar would be off by about 24 days, causing midsummer to drift into autumn over centuries.
Julius Caesar introduced the Julian calendar, which added a leap day every four years (every year divisible by 4). This overcorrects slightly — adding 0.25 days per year instead of 0.2422, causing a drift of about 3 days every 400 years.
Pope Gregory XIII refined the system by introducing the century rule: years divisible by 100 are not leap years, unless also divisible by 400. This gives an average year of 365.2425 days — far closer to the solar year of 365.2422 days. The remaining error is only about 1 day every 3,300 years.
A leap second is an occasional 1-second adjustment to Coordinated Universal Time (UTC) and is entirely separate from a leap year. Leap seconds address Earth's irregular rotation; leap years address the orbital period.
People born on February 29 are sometimes called leaplings or leap-day babies. Legally and socially, most countries recognize February 28 or March 1 as their birthday in non-leap years.
The next leap year after 2024 is **2028**. It is divisible by 4 and not by 100, so it qualifies under the standard Gregorian rule.
A leap year has **366 days**. The extra day is inserted as **February 29**, extending February from 28 to 29 days.
No. 1900 is divisible by 100 but not by 400, so it is NOT a leap year. Many people incorrectly assume it was because it is divisible by 4.
In a leap year, **February has 29 days**. April, June, September, and November always have 30 days. January, March, May, July, August, October, and December always have 31 days.
Apply the three-step test: (1) Is it divisible by 4? If no → not a leap year. If yes → go to step 2. (2) Is it divisible by 100? If no → it IS a leap year. If yes → go to step 3. (3) Is it divisible by 400? If yes → it IS a leap year. If no → it is NOT a leap year.
Yes. 2024 is divisible by 4 (2024 ÷ 4 = 506) and is not divisible by 100, so it satisfies the Gregorian leap year rule. February 2024 had 29 days.
No. Although 2100 is divisible by 4, it is also divisible by 100 but NOT by 400 (2100 ÷ 400 = 5.25). The century rule disqualifies it. The next century leap year after 2000 will be 2400.
Roughly every 4 years, but with century-year exceptions. In every 400-year cycle there are exactly **97 leap years** — not 100 — because three out of four century years are excluded.
There is no universal legal standard. Most countries default to either February 28 or March 1 for annual events that fall on February 29 (e.g., birthdays, contract dates). Check local laws for legal implications.
The Gregorian calendar was adopted in 1582, so the formula strictly applies from that point forward. For dates before 1582, historians use the **proleptic Gregorian calendar** (applying the same rules backwards) or the Julian calendar, depending on context.
Averaging 365.25 days per year (the Julian approach) overestimates the solar year by 0.0078 days annually. Over 128 years that's one full extra day. The Gregorian 365.2425-day average reduces this error to just 1 day per ~3,300 years.
Only sources that have been reviewed are shown. Unverified citations are never published.