How Do Leap Years Work? The Rule and How to Check a Year
A year is a leap year if it can be divided evenly by 4, except for century years such as 1900 and 2100, which are leap years only if they can also be divided by 400. A leap year has 366 days instead of 365, and the extra day is 29 February. So 2024 and 2028 are leap years, 2000 was one, and 1900 and 2100 are not. Type any year into the leap year checker to test it.
The rule in three checks
Ask these questions in order:
- Can the year be divided by 4? If not, it is not a leap year. 2026 ÷ 4 = 506.5, so 2026 is a common year.
- Can it be divided by 100? If not, it is a leap year. 2028 ÷ 4 = 507 and 2028 is not a century year, so 2028 is a leap year.
- If it can be divided by 100, can it also be divided by 400? If yes, it is a leap year. If no, it is not. 2000 ÷ 400 = 5, so 2000 was a leap year. 2100 ÷ 400 = 5.25, so 2100 will not be one.
Between 1901 and 2099, the first check alone gives the right answer for every year. The century rule next matters in 2100.
Why we have leap years
The calendar tries to keep step with the seasons. The time it takes for the seasons to come round again, called the tropical year, is about 365.2422 days. A calendar of exactly 365 days falls behind by about 0.2422 days a year, which adds up to almost a whole day (0.9688 days) every four years. Without a fix, the dates of the seasons would slowly move around the calendar.
The older Julian calendar, from Roman times, added a leap day every four years with no exceptions. That makes the average year 365.25 days, about 0.0078 days too long. The error is small, but it adds up to one day roughly every 128 years.
By the 16th century the calendar had drifted by about ten days, so in 1582 Pope Gregory XIII introduced the Gregorian calendar. It skips three leap days every 400 years, in the century years that cannot be divided by 400. That leaves 97 leap years in every 400, and an average year of 365 + 97 ÷ 400 = 365.2425 days. This is within about 0.0003 days of the tropical year, an error of one day in more than 3,000 years. Countries switched at different times. Britain and its colonies, for example, changed in 1752.
The leap year checker uses these Gregorian rules for any year from 1 to 9999.
The next leap years
After 2024, the next leap years are 2028, 2032, 2036, 2040, 2044 and 2048. Each one has a 29 February, and the day of the week finder shows which day it falls on:
- 29 February 2028 is a Tuesday.
- 29 February 2032 is a Sunday.
- 29 February 2036 is a Friday.
- 29 February 2040 is a Wednesday.
How a leap year changes dates
The extra day shifts everything after February by one.
- Days in the year. The days in year calculator gives 366 days for 2028 and 365 for 2026.
- Days in February. The days in month calculator gives 29 days for February 2028 and 28 for February 2100.
- Day numbers. The day of year calculator shows that 1 March is day 61 in 2028 but day 60 in 2026, and 31 December 2028 is day 366.
This matters for anything counted in days: interest calculated per day, contract periods, visa stays, and the number of days between two dates. A period that crosses 29 February is one day longer than the same dates in a common year.
Worked example: is 2100 a leap year?
- 2100 ÷ 4 = 525. It divides evenly, so keep going.
- 2100 ÷ 100 = 21. It is a century year, so the 400 rule decides.
- 2100 ÷ 400 = 5.25. It does not divide evenly.
So 2100 is not a leap year. February 2100 will have 28 days, and the year will have 365 days. The leap year checker gives the same answer: 2100 is not a leap year. The next century leap year after 2000 is 2400.
Check a leap year in a spreadsheet or code
In Excel or Google Sheets, with the year in cell A1:
=IF(OR(MOD(A1,400)=0,AND(MOD(A1,4)=0,MOD(A1,100)<>0)),"Leap year","Not a leap year")
In JavaScript:
const isLeap = y => (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
In Python, the standard library already has it: calendar.isleap(2028) returns True.
One known trap: Excel treats 1900 as a leap year and accepts 29 February 1900 as a date, although that day never existed. Microsoft documents this as a choice made long ago to stay compatible with Lotus 1-2-3. It only affects dates before 1 March 1900, so most spreadsheets never notice.
Leap day birthdays
People born on 29 February have a real birthday only in leap years. In other years, the legal birthday is either 28 February or 1 March depending on the country, so check the rule where you live if the exact date matters. The guide on how to calculate age covers this in more detail.
Common mistakes
Stopping at the divide by 4 test. It works for every year in our lifetimes, but code that only checks for 4 will be wrong in 2100. Use all three checks.
Assuming every year has 365 days. Dividing a number of days by 365 to get years slowly drifts because of leap years. Date tools that count real calendar days avoid this.
Questions and answers
Is 2026 a leap year?
No. 2026 cannot be divided evenly by 4, so it has 365 days and February has 28 days. The next leap year is 2028.
Why is 2100 not a leap year?
Century years are leap years only if they can be divided by 400. 2100 ÷ 400 = 5.25, so 2100 is a common year with 365 days, even though it divides by 4.
How many leap years are there in 400 years?
97. There would be 100 if every fourth year counted, but the Gregorian calendar skips three century years in every 400, such as 2100, 2200 and 2300.