About this tool
The Leap Year Calculator tells you whether a given year has 366 days and, more usefully, why: it walks through the Gregorian rule for that specific year, showing whether it is divisible by 4, by 100, and by 400, and which step decides the answer. It then gives the next and previous leap years, the weekday of that year's February 29, and the count of leap years between any two years you choose, with the full list. It is useful for anyone checking a date calculation, planning around February 29, working out a leapling's birthday, or explaining to a student why 1900 was not a leap year but 2000 was.
How it works
A year is a leap year in the Gregorian calendar if it is divisible by 4, except that years divisible by 100 are common years, unless they are also divisible by 400. In code: leap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0. This gives 97 leap years in every 400, an average year of 365.2425 days, within about 27 seconds of the mean tropical year. The count between two years is found by counting multiples of 4, subtracting multiples of 100, and adding back multiples of 400, checked against a direct loop. The next and previous leap years are found by stepping one year at a time, so century boundaries are handled correctly. The weekday of February 29 comes from the browser's proleptic Gregorian calendar.
Frequently asked questions
Why was 1900 not a leap year when 2000 was?
Both are divisible by 4 and by 100, so the century exception applies to each. But 2000 is also divisible by 400, which restores the leap day; 1900 is not, so it stayed a common year. The next century year to be a leap year is 2400. 2100, 2200, and 2300 will all be common years with 365 days.
How many leap years are there between 2000 and 2100?
Twenty-five: 2000, 2004, 2008 and every fourth year through 2096. 2100 is excluded because it is divisible by 100 but not by 400. Counting 2000 to 2099 inclusive gives the same 25, since 2100 never qualifies; counting 2001 to 2100 gives 24.
Why does the calendar need leap years at all?
The Earth takes about 365.2422 days to orbit the Sun, so a 365-day calendar would drift by nearly a day every four years, putting the seasons a month out within about 120 years. Adding a day every four years overcorrects slightly (365.25 days), so the Gregorian reform of 1582 removed three leap days every 400 years to reach 365.2425, a much closer fit.
Did the Julian calendar use the same rule?
No. The Julian calendar, in use across Europe until 1582 and in some countries until the early twentieth century, made every year divisible by 4 a leap year with no century exception. That is why Julian dates drifted 10 days behind the seasons by 1582 and 13 days by 1900. This page applies the Gregorian rule to every year, including those before 1582.