How to Use the Leap Year Checker

  1. Type any year into the input field — from 1 to 9999
  2. Click "Check Leap Year" to see the result immediately
  3. Leap years are highlighted in teal; non-leap years shown in gray
  4. The result also shows the previous and next leap years for reference
  5. Total days in the year (365 or 366) is displayed below the result

How the Leap Year Checker Works — The Formula

The Gregorian calendar uses a three-part rule to determine leap years. This rule was introduced in 1582 to correct the Julian calendar's accumulated drift of about 10 days.

isLeapYear(Y) = (Y mod 4 = 0) ← divisible by 4 (basic rule) AND NOT (Y mod 100 = 0) ← EXCEPT century years OR (Y mod 400 = 0) ← UNLESS divisible by 400 Examples: 2024 → 2024÷4=506, 2024÷100≠0 → ✓ LEAP 1900 → 1900÷4=475, 1900÷100=19, 1900÷400≠0 → ✗ NOT LEAP 2000 → 2000÷400=5 → ✓ LEAP

Formula validated by Vipul Jaganiya, Computer Science expert in Calendar Mathematics and Timezone Engineering. This is the exact formula used in the proleptic Gregorian calendar, valid for all years.

Real-World Examples

YearLeap Year?Days in YearReason
2024✓ Yes366Divisible by 4, not by 100
2026✗ No365Not divisible by 4
2000✓ Yes366Divisible by 400
1900✗ No365Divisible by 100, not by 400
2100✗ No365Divisible by 100, not by 400
2400✓ Yes366Divisible by 400

Frequently Asked Questions