Last verified · v1.0
Calculator · general
Leap Year Calculator
Check if any year is a leap year, find the next or previous leap year, or count leap years between two years using the Gregorian three-rule formula.
Inputs
Result
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
What Is a Leap Year?
A leap year is a calendar year that contains 366 days rather than the standard 365. The extra day — February 29, sometimes called an intercalary day — is inserted to synchronize the human calendar with Earth's actual orbital period around the sun. Earth completes one solar orbit in approximately 365.2422 days, meaning a strict 365-day calendar drifts about 0.2422 days per year. Without periodic correction, the calendar would fall behind by one full day roughly every four years, causing the seasons to shift out of alignment with their calendar months over centuries.
The Three-Part Gregorian Leap Year Rule
The Gregorian calendar, introduced by Pope Gregory XIII in 1582 and now used as the international civil standard, resolves this drift with a three-condition algorithm. As documented by Rhodes College COMP 141 and Franklin University ITEC 136, the rule works as follows:
- Rule 1 — Divisible by 4: A year divisible by 4 is a leap year. This accounts for the 0.25-day annual surplus by adding one extra day every four years.
- Rule 2 — Century exception: If the year is also divisible by 100, it is not a leap year. Adding a day every four years slightly overcorrects by 0.0078 days per year, accumulating to roughly 0.78 days per century. Skipping century years removes most of this excess.
- Rule 3 — 400-year override: If the year is divisible by 400, it is a leap year. Removing every century year overcorrects in the opposite direction by approximately 0.03 days per 400 years, so every 400th year the leap day is restored. This yields a long-run accuracy within 26 seconds per year.
The complete mathematical expression is: Leap(y) = 1 if (y mod 4 = 0 AND y mod 100 not equal to 0) OR (y mod 400 = 0); otherwise Leap(y) = 0.
Worked Examples
Applying the formula to common test cases clarifies how the three rules interact:
- 2024: 2024 divided by 4 = 506 with no remainder — passes Rule 1. 2024 divided by 100 = 20.24 — Rule 2 does not apply. Result: leap year (366 days).
- 1900: 1900 divided by 4 = 475 — passes Rule 1. 1900 divided by 100 = 19 with no remainder — Rule 2 triggers, disqualifying it. 1900 divided by 400 = 4.75 — Rule 3 does not apply. Result: not a leap year.
- 2000: 2000 divided by 4 = 500 — passes Rule 1. 2000 divided by 100 = 20 — Rule 2 triggers. 2000 divided by 400 = 5 with no remainder — Rule 3 overrides. Result: leap year.
- 2100: 2100 divided by 4 = 525 — passes Rule 1. 2100 divided by 100 = 21 — Rule 2 triggers. 2100 divided by 400 = 5.25 — Rule 3 does not apply. Result: not a leap year.
Calculator Modes Explained
This leap year calculator offers four distinct modes to answer the most common leap year queries:
- Single Year Check: Enter any 4-digit Gregorian year and the calculator instantly applies all three rules to return a definitive leap or non-leap result.
- Next Leap Year: Starting from a given year, the calculator identifies the nearest upcoming leap year, stepping forward until the three-part test is satisfied.
- Previous Leap Year: Locates the most recent leap year before the entered year, useful for date-range calculations and historical research.
- Count Leap Years in a Range: Enter a start year and an inclusive end year to count exactly how many leap years fall within the range. From 2000 to 2024, there are 7 leap years: 2000, 2004, 2008, 2012, 2016, 2020, and 2024.
Practical Applications
Accurate leap year identification matters across many real-world domains. Financial institutions must account for the 366-day year when computing daily interest accrual and APY calculations. The Consumer Financial Protection Bureau Regulation DD Appendix A explicitly governs 365/366-day year treatment for Annual Percentage Yield calculations, making leap year accuracy a regulatory compliance requirement for banks and credit unions. Software engineers building date-handling logic, payroll systems, or scheduling software must implement the three-rule check precisely to prevent off-by-one errors around February 28-29. People born on February 29 — sometimes called leaplings — use this calculator to determine when their actual birthday falls. Contract lawyers computing exact day counts, project managers planning multi-year timelines, and astronomers tracking tropical-year accumulation all rely on accurate leap year data.
Counting Leap Years Between Two Years
To count leap years between year A and year B (inclusive), the most reliable method applies the Gregorian formula to each year in the range. For large ranges, a closed-form approach subtracts the count of years divisible by 4, 100, and 400 below A from the corresponding counts at or below B, then adjusts for boundary inclusivity. This calculator performs that computation instantly for any valid 4-digit year range, eliminating manual iteration errors.
Reference