Skip to content
Date & Timedates

Leap Year Checker

Whether a year is a leap year, including the century rule that catches people out. 1900 was not a leap year and 2000 was.

Also called: is it a leap year, leap year test.

Result
2100 is not a leap year. It is divisible by 100 but not by 400, which is the exception most people forget.

2100 is not a leap year. It is divisible by 100 but not by 400, which is the exception most people forget.

Leap year (1 = yes)
0
Days in the year
365
Next leap year
2,104
Method and background

How this is calculated

A tropical year is about 365.2422 days, so adding a day every four years overshoots slightly. Skipping the century years corrects too far, and restoring every fourth century corrects back. The remaining error is about one day in 3,200 years.

leap = (year %% 4 == 0 and year %% 100 != 0) or year %% 400 == 0
y
The year

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

2100 is not a leap year

Year
2,100

Result2100 is not a leap year. It is divisible by 100 but not by 400, which is the exception most people forget.

divisible by 100 but not 400: the century exception

Open this example

2000 was

Year
2,000

Result2000 is a leap year, so it has 366 days.

divisible by 400: the exception to the exception

Open this example

2024 was

Year
2,024

Result2024 is a leap year, so it has 366 days.

ordinary four-year rule

Open this example