Leap Year Calculator
Check if any year is a leap year and find all leap years in a date range.
Check Year
Find Leap Years in Range
Leap Year Rules
- 1. Divisible by 4 = leap year
- 2. EXCEPT if divisible by 100 = not leap year
- 3. EXCEPT if divisible by 400 = leap year
2026
Year Details
Nearby Leap Years
Leap Years 2000-2100 (25 total)
What Is a Leap Year?
A leap year is a calendar year that contains an extra day — February 29 — making it 366 days long instead of the usual 365. Leap years exist to keep the calendar aligned with Earth's actual orbital period around the Sun, which is approximately 365.2422 days (the tropical year). Without leap years, the calendar would drift approximately 1 day every 4 years, causing the seasons to gradually shift — summer in December, winter in June — over several centuries.
The Gregorian calendar, which is the most widely used civil calendar in the world, uses the following rule to determine whether a year is a leap year:
- A year is a leap year if it is divisible by 4 (e.g., 2024, 2028)
- Except: Years divisible by 100 are not leap years (e.g., 1800, 1900)
- Except the exception: Years divisible by 400 are leap years (e.g., 1600, 2000, 2400)
This three-part rule gives the Gregorian calendar an average year length of exactly 365.2425 days — extremely close to the actual tropical year of 365.2422 days. The error accumulates to only 1 day in approximately 3,030 years.
The Leap Year Rule
The Gregorian leap year rule can be expressed compactly as a logical formula:
Gregorian Leap Year
Where:
- year % 4 === 0= Divisible by 4 — the basic 4-year rule; true for most leap years
- year % 100 !== 0= NOT divisible by 100 — excludes century years from the 4-year rule
- year % 400 === 0= Divisible by 400 — overrides the century exclusion; makes every 400th year a leap year
- daysInFeb= 29 if isLeapYear is true, 28 otherwise
- totalDays= 366 if isLeapYear is true, 365 otherwise
Why Three Rules? The Calendar Math
The three-part rule results from an attempt to approximate 365.2422 days as precisely as possible using simple integer arithmetic:
| Rule | Effect | Average Year Length | Error vs. Tropical Year |
|---|---|---|---|
| Every 4 years | Add 1 day each 4 years | 365.25 days | +0.0078 days/year (too long) |
| Minus centuries | Remove 1 day each 100 years | 365.24 days | −0.0022 days/year (too short) |
| Plus 400-year | Add 1 day each 400 years | 365.2425 days | +0.0003 days/year (very close) |
How to Use This Calculator
- Enter a Year: Type any year in the Year field to immediately see whether it is a leap year.
- Read the Results: The result shows whether the year is a leap year, how many days it has (365 or 366), and how many days February has (28 or 29).
- Nearby Leap Years: A list of surrounding leap years is displayed to provide context.
- Leap Year Range: Enter a Start Year and End Year to generate a complete list of all leap years in that span.
Real-World Applications
Software developers frequently need to check for leap years when implementing date arithmetic, billing systems that charge monthly fees, age calculators, anniversary reminder applications, and any system where exact day counts matter. The February 28/29 boundary is a classic source of off-by-one errors in code that handles date ranges.
People born on February 29 (called leaplings or leap day babies) celebrate their exact birthday only once every four years. Legal systems and computer systems handle these birthdays differently — some consider the birthday to fall on February 28 in non-leap years, others on March 1. Software handling birth dates must explicitly account for this edge case.
Financial systems that calculate daily interest, bond yields, or lease payments need to correctly handle the extra day in leap years. The difference between 365 and 366 days can materially affect the present value of long-duration instruments — especially those using actual/365 or actual/366 day count conventions.
Worked Examples
Is 2024 a Leap Year?
Problem:
Determine whether 2024 is a leap year.
Solution Steps:
- 12024 % 4 = 0 ✓ (divisible by 4)
- 22024 % 100 = 24 ≠ 0 (NOT a century year)
- 3Result: (true && true) || false = true
Result:
2024 IS a leap year. February has 29 days; the year has 366 days.
Is 1900 a Leap Year?
Problem:
Was 1900 a leap year in the Gregorian calendar?
Solution Steps:
- 11900 % 4 = 0 ✓ (divisible by 4)
- 21900 % 100 = 0 → (year % 100 !== 0) = FALSE (IS a century year)
- 31900 % 400 = 300 ≠ 0 (not divisible by 400)
- 4Result: (true && false) || false = false
Result:
1900 is NOT a leap year. Many old software systems (including Excel) got this wrong, treating 1900 as a leap year.
Is 2000 a Leap Year?
Problem:
Was 2000 a leap year?
Solution Steps:
- 12000 % 4 = 0 ✓
- 22000 % 100 = 0 → century year, first condition fails
- 32000 % 400 = 0 ✓ → overrides the century exclusion
- 4Result: (true && false) || true = true
Result:
2000 IS a leap year (divisible by 400). This is often a source of confusion since 1900 was not a leap year but 2000 was.
Tips & Best Practices
- ✓Quick check: a year ending in '00' is a leap year ONLY if it's also divisible by 400 (so 2000=yes, 2100=no, 2400=yes).
- ✓For most years, just check divisible by 4 — the century-year exception only applies every 100 years.
- ✓In code: isLeapYear = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0 — memorize this pattern.
- ✓February 29 is the rarest calendar date, occurring only ~24.25% of years vs. 100% for most other dates.
- ✓Excel treats 1900 as a leap year (a known bug inherited from Lotus 1-2-3) — be careful when working with dates near February 1900 in spreadsheets.
- ✓Next 3 leap years from 2024: 2028, 2032, 2036 — none of these are century years, so the simple 'divisible by 4' rule applies.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-06
Help us improve!
How would you rate the Leap Year Calculator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various