terican

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.

FreeInstantNo signupOpen source

Inputs

Result

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Result

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

Frequently asked questions

What is a leap year and why does it exist?
A leap year is a calendar year with 366 days, including February 29 as an extra intercalary day. It exists because Earth completes one solar orbit in approximately 365.2422 days, not exactly 365. Without periodic correction, the Gregorian calendar would drift roughly one full day every four years, eventually misaligning seasons with their calendar months by weeks or months over long periods. The three-part leap year rule corrects this drift to within 26 seconds per year.
How do you manually calculate whether a year is a leap year?
Apply the three-step Gregorian test: first, check whether the year is divisible by 4 — if not, it is not a leap year. Second, check whether it is divisible by 100 — if so, it is not a leap year. Third, check whether it is divisible by 400 — if so, it is a leap year despite the century rule. For example, 2024 passes step one and fails step two, making it a leap year. The year 1900 passes step one, triggers step two, and fails step three, making it a standard year.
Was 1900 a leap year?
No, 1900 was not a leap year. Although 1900 is divisible by 4, it is also divisible by 100, which triggers the Gregorian century exception. Because 1900 is not divisible by 400, the 400-year override does not apply. This makes 1900 one of the most commonly misidentified non-leap years. Many people apply only the simple divide-by-4 test and overlook the century rule, incorrectly assuming 1900 had a February 29.
Was 2000 a leap year?
Yes, 2000 was a leap year. Although 2000 is divisible by 100 — which normally disqualifies a year — it is also divisible by 400, which reinstates its leap year status under the Gregorian three-part rule. The year 2000 is historically notable because some early computer systems failed to implement the 400-year override correctly, contributing to Y2K date-calculation concerns. The next century year to qualify as a leap year will be 2400.
When is the next leap year after 2025?
The next leap year after 2025 is 2028. The years 2026 and 2027 are not divisible by 4, so both fail the first condition of the Gregorian rule immediately. The year 2028 is divisible by 4 and is not divisible by 100, so it satisfies the leap year criteria. February 2028 will include February 29, giving the year 366 days in total instead of the standard 365.
How many leap years occur in a 100-year period?
Most 100-year periods contain 24 leap years, because the century year itself — such as 1900 or 2100 — is disqualified by the divisible-by-100 rule. However, a century that includes a year divisible by 400, such as the span containing 2000, contains 25 leap years. Over a complete 400-year Gregorian cycle, there are exactly 97 leap years, yielding an average calendar year length of 365.2425 days.