Leap Year Checker: Find Out If a Year Is a Leap Year
Check whether any year from 1000 to 9999 is a leap year under the Gregorian calendar rule. A leap year has 366 days, including an extra day, February 29.
Leap Year Checker
Documentation
What Is a Leap Year?
A leap year is a calendar year with an extra day, February 29, making it 366 days long instead of the usual 365. The Gregorian calendar, used by most of the world today, adds this extra day about once every four years to stay in step with Earth's orbit around the Sun.
Earth takes about 365.2422 days to complete one orbit, not exactly 365. Without leap years, the calendar would slowly drift out of step with the seasons.
The Leap Year Rule
A year is a leap year if it meets these conditions, checked in order:
- The year is divisible by 400. It is a leap year.
- The year is divisible by 100 but not by 400. It is not a leap year.
- The year is divisible by 4 but not by 100. It is a leap year.
- None of the above apply. It is not a leap year.
As a single formula: a year Y is a leap year if (Y is divisible by 4 and not by 100) or (Y is divisible by 400).
Leap Year Formula and How to Calculate It
To check a year by hand, test divisibility by 400, then 100, then 4, in that order.
- Divide the year by 400. No remainder means it is a leap year. Stop here.
- If there is a remainder, divide the year by 100. No remainder means it is not a leap year. Stop here.
- If there is a remainder, divide the year by 4. No remainder means it is a leap year.
- If none of these divide evenly, the year is not a leap year.
Most programming languages check this with the modulo operator, written %. The expression year % 4 == 0 is true when the year divides evenly by 4. Checking 400 before 100, and 100 before 4, is what makes century years like 2000 and 1900 come out correctly.
Worked Examples
2024: 2024 Ă· 4 = 506, with no remainder, and 2024 is not divisible by 100. 2024 is a leap year. February 2024 had 29 days.
1900: 1900 Ă· 100 = 19, with no remainder, so 1900 is a century year. 1900 Ă· 400 = 4.75, not a whole number. 1900 is not a leap year, even though it divides evenly by 4.
2000: 2000 Ă· 400 = 5, with no remainder. 2000 is a leap year, one of the few century years that qualifies.
2025: 2025 Ă· 4 = 506.25, not a whole number. 2025 is not a leap year.
Using the Leap Year Checker
Enter a year between 1000 and 9999 in the input field and select "Check." The tool applies the Gregorian rule and reports whether the year is a leap year. A year outside that range, or an entry that is not a whole number, produces an error asking for a valid four-digit year.
Why Leap Years Exist
A solar year, the time Earth takes to orbit the Sun once, lasts about 365.2422 days. A calendar built on exactly 365 days would fall behind by roughly a quarter of a day every year. After a century, the seasons would drift about 24 days from where the calendar says they should be.
Adding one day every four years corrects most of that drift. But four quarter-days add up to slightly more than one full day, so the calendar needs a further correction. The Gregorian calendar removes three leap years every 400 years by skipping the leap day in century years that are not divisible by 400, such as 1700, 1800, and 1900.
This leaves an average year length of 365.2425 days (365 + 97/400), close to the true solar year of 365.2422 days. The remaining gap is about 26 seconds a year, or roughly one day every 3,300 years.
A Brief History of the Leap Year
Julius Caesar introduced a leap year every four years in 45 BCE, on the advice of the astronomer Sosigenes of Alexandria. This Julian calendar assumed a year of exactly 365.25 days. Because the true solar year is slightly shorter, the Julian calendar drifted by about one day every 128 years.
By the 1500s the drift had reached ten days, and the date of the spring equinox no longer matched the calendar. Pope Gregory XIII introduced a reform in 1582, based on work by the astronomers Aloysius Lilius and Christopher Clavius. Ten days were removed from the calendar, and the rule for century years was added so that only years divisible by 400 stay leap years.
Countries adopted the Gregorian calendar at different times. Catholic countries switched in 1582. Britain and its colonies switched in 1752, skipping eleven days. Russia did not switch until 1918, after the Bolshevik Revolution, and Greece waited until 1923.
Where Leap Years Matter
Software that handles dates has to account for leap years, or it can miscalculate when a user selects February 29. Financial systems use day-count rules that treat leap years differently from common years when they calculate interest and bond prices. People born on February 29 have an actual birthday only once every four years; many jurisdictions treat February 28 or March 1 as their legal birthday in other years.
Frequently Asked Questions
Is 2024 a leap year? Yes. 2024 is divisible by 4 and is not a century year, so it is a leap year with 366 days.
Is 2025 a leap year? No. 2025 is not divisible by 4, so it is a common year with 365 days.
Will 2028 be a leap year? Yes. 2028 is divisible by 4 and is not a century year.
Why was 2000 a leap year but 1900 was not? Century years must be divisible by 400 to stay leap years. 2000 divides evenly by 400, so it kept its leap day. 1900 does not divide evenly by 400, so it lost its leap day even though it divides evenly by 4.
How many leap years occur in 400 years? 97. Of the 100 years in that span divisible by 4, three century years are removed because they are not divisible by 400.
Will 2100 be a leap year? No. 2100 is divisible by 100 but not by 400, so it will not have a February 29. The next century leap year after 2000 is 2400.
References
- "Gregorian Calendar." Encyclopædia Britannica.
- "Calendar." Encyclopædia Britannica.
- Richards, E. G. Mapping Time: The Calendar and Its History. Oxford University Press, 1998.
- "ISO 8601 Date and Time Format." International Organization for Standardization.