Leap Year Checker
Check whether any year is a leap year and learn the rules.
About the Leap Year Checker
The Leap Year Checker tests whether any year between 1 and 9999 is a leap year under the Gregorian calendar rules, then explains the math behind the verdict. Beyond a simple yes/no, it shows the specific rule that applied (divisible by 4, divisible by 100 but not 400, or divisible by 400), the number of days in the year, whether February 29 exists, and the next and previous leap years.
Leap years exist because the tropical year (the time between two vernal equinoxes) is approximately 365.2422 days — not exactly 365. Without leap years, the calendar would drift by about 1 day every 4 years, and after 100 years the seasons would be off by about 24 days. Julius Caesar introduced the Julian calendar in 46 BCE with a leap year every 4 years, but this overcorrected by 0.0078 days per year, accumulating to a 10-day drift by 1582.
Pope Gregory XIII introduced the Gregorian calendar in October 1582 to fix the drift. He skipped 10 days (October 4 was followed by October 15) and added the century rule: years divisible by 100 are not leap years unless also divisible by 400. This produces an average year length of 365.2425 days — within 26 seconds of the actual tropical year, accumulating to a 1-day drift every 3,300 years.
How It Works
The Gregorian leap year rule has three layers, applied in order:
- Divisible by 4? If no, not a leap year. This catches 75% of years.
- Divisible by 100? If yes (and not by 400), not a leap year. This catches century years like 1700, 1800, 1900, 2100 — they are divisible by 4 but excluded by the century rule.
- Divisible by 400? If yes, leap year. This overrides the century rule for years like 1600, 2000, 2400 — they are divisible by 100 but rescued by the 400-year rule.
The combined rule produces a 400-year cycle of 146,097 days, which is exactly 20,871 weeks. This means the calendar repeats exactly every 400 years — January 1, 2000 was a Saturday, and January 1, 2400 will also be a Saturday. The 400-year cycle contains 97 leap years (not 100, because the 3 excluded century years per cycle — 1700, 1800, 1900 in the cycle starting 1600 — reduce the count from 100 to 97).
The average year length is 146097 / 400 = 365.2425 days. The actual tropical year (based on the vernal equinox) is 365.2422 days. The difference is 0.0003 days per year, accumulating to a 1-day drift every 3,300 years. The Gregorian calendar is therefore very accurate but not perfect — future calendar reform (perhaps a 4000-year rule) may eventually be needed.
The historical adoption of the Gregorian calendar varied widely: Catholic countries adopted it in 1582, Protestant German states in 1700, Britain and its colonies in 1752 (skipping 11 days), Russia in 1918 (after the Bolshevik Revolution), and Greece in 1923. This is why the October Revolution is celebrated in November — Russia was still on the Julian calendar in October 1917 when the revolution occurred.
Worked Examples
For 2024, the checker reports: leap year, reason “Divisible by 4 but not by 100 (506 × 4 = 2024) → leap year.” February 29 exists, the year has 366 days, the next leap year is 2028, the previous was 2020.
For 1900, the checker reports: not a leap year, reason “Divisible by 100 but not by 400 → not a leap year. The 100-year rule excludes century years unless they are also divisible by 400.” This is the source of the famous Y2K bug concern — some legacy software incorrectly treated 2000 as a non-leap year because they only checked the 100-year rule.
For 2000, the checker reports: leap year, reason “Divisible by 400 (5 × 400 = 2000) → leap year. The 400-year rule overrides the 100-year rule.” This was the most recent 400-year exception; the next will be 2400.
For 2100, the checker reports: not a leap year — this is the next century year that will be skipped. February 2100 will have only 28 days, which will catch some buggy software that only checks the 4-year rule. The previous leap year was 2096; the next will be 2104.
When to Use This Tool
- Verifying leap year status for date arithmetic in custom calendar implementations.
- Testing calendar software against edge cases (1900, 2000, 2100) before deployment.
- Determining whether February 29 exists in a given year for birthday and anniversary tracking.
- Computing the day count for a year (365 vs 366) for billing, interest, and pro-rata calculations.
- Teaching the Gregorian calendar rules and the 400-year cycle in math and astronomy classes.
- Validating the leap year logic in spreadsheets, databases, and programming language date libraries.
- Demonstrating the Y2K bug class — software that checked only the 4-year rule incorrectly treated 2000 as a non-leap year.
Limitations & Disclaimer
This checker applies the standard Gregorian calendar rules (divisible by 4, except century years not divisible by 400). It uses the proleptic Gregorian calendar for all years 1-9999, which extends Gregorian rules backward to dates before its introduction in 1582. Historical records from before 1582 may use the Julian calendar, which has different leap year rules (every 4 years without exception). The calculator does not handle the Julian calendar, the Hijri calendar, the Hebrew calendar, or any other non-Gregorian calendar system. The year range is 1-9999; for years outside this range (e.g., astronomical year numbering with negative years for BCE), use a dedicated calendar library. The reported 1-day drift every 3,300 years is theoretical and may eventually require calendar reform. See our disclaimer for full terms.
Frequently Asked Questions
Why do we have leap years?
The tropical year (the time between two vernal equinoxes) is approximately 365.2422 days — not exactly 365. Without leap years, the calendar would drift by about 1 day every 4 years. After 100 years, the seasons would be off by 24 days; after 700 years, the calendar would be a full season off. Leap years keep the calendar aligned with the seasons.
What is the difference between the Julian and Gregorian calendars?
The Julian calendar (introduced 46 BCE) has a leap year every 4 years without exception, producing an average year of 365.25 days — 0.0078 days too long. By 1582 the drift had accumulated to 10 days. The Gregorian calendar (introduced 1582) added the century rule: years divisible by 100 are not leap unless also divisible by 400. This produces an average year of 365.2425 days — within 26 seconds of the actual tropical year.
Why are century years sometimes not leap years?
Because the basic 4-year rule overcorrects. A 4-year leap cycle gives 365.25 days per year, but the actual tropical year is 365.2422 days — a difference of 0.0078 days per year, accumulating to about 0.78 days per century. Skipping the century year removes one leap day every 100 years, but that overcorrects in the other direction (removing 1.00 days per century instead of 0.78). The 400-year rule restores one leap day every 400 years, balancing the overcorrection. The combined rule gives 365.2425 days per year.
What happens on February 29 in non-leap years?
Nothing — February 29 does not exist. JavaScript’s <code>Date</code> object handles this by rolling over to March 1: <code>new Date(2023, 1, 29)</code> gives March 1, 2023, not February 29, 2023. The checker tests this by creating a Date object for February 29 of the given year and verifying that <code>getMonth()</code> still returns 1 (February), not 2 (March).
How do leap year babies celebrate birthdays?
Legally, the convention varies by jurisdiction. Most countries treat March 1 as the birthday for February 29 babies in non-leap years (so they would turn 18 on March 1, 2024 if born on February 29, 2006). Some U.S. states use February 28 instead. The New Zealand Transport Agency uses February 28 for driver’s license renewal. Always check your local jurisdiction’s rule.
When will the next 400-year exception occur?
In the year 2400. The most recent 400-year exception was 2000 (the famous Y2K leap year that some buggy software incorrectly treated as non-leap). The 400-year rule was added by Pope Gregory XIII in 1582 specifically to handle this case — without it, 2000 would have been incorrectly treated as non-leap, causing a 1-day calendar drift in many software systems.
Last updated: July 21, 2026 · Author: HT99 Tools Editorial Team · Reviewed by: HT99 Tools Editorial Team