toolqik

106 · Date & Time

Leap Year Checker

Check whether a year is a leap year, or list the leap years in a range.

Runs in your browser

    About this tool

    Type a year to find out whether it’s a leap year, with the rule that decides it. Enter several years, or a range like 1900-2100, to list which of them are leap years.

    The leap year rule

    In the Gregorian calendar, a year is a leap year if:

    1. it is divisible by 4,
    2. except years divisible by 100, which are not,
    3. unless they are also divisible by 400, which are.

    So 2024 is a leap year, 1900 and 2100 are not, and 2000 is. The next century leap year after 2000 is 2400.

    Why leap years exist

    The Earth takes about 365.2422 days to orbit the Sun. An extra day every four years (as in the Julian calendar) gives 365.25 days, slightly too long, so the calendar drifted about 3 days every 400 years. The Gregorian reform of 1582 dropped three leap days per 400 years, giving an average of 365.2425 days, accurate to about one day in 3,000 years.

    In code

    // JavaScript
    const isLeap = (y) => (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
    
    # Python
    import calendar; calendar.isleap(2024)
    
    -- Excel
    =IF(DAY(DATE(A1,2,29))=29,"Leap","Common")

    A classic bug is checking only y % 4 === 0, which gets 1900 and 2100 wrong. Dates before 1582 (and before each country adopted the Gregorian calendar) followed the older Julian rule.

    FAQ

    Is 2024 a leap year?

    Yes. 2024 is divisible by 4 and is not a century year, so February 2024 has 29 days.

    Is 2100 a leap year?

    No. 2100 is divisible by 100 but not by 400, so it is a common year with 365 days.

    Why was 2000 a leap year but 1900 was not?

    Century years are leap years only if divisible by 400. 2000 is (2000 ÷ 400 = 5); 1900 is not.

    When is the next leap year?

    Enter the current year and the next and previous leap years are shown below the result.

    How many days are in a leap year?

    366, because February has 29 days instead of 28.

    esc
    ↑↓ navigate↵ open