A year either has 365 days or 366, and the difference comes down to a short divisibility test. Knowing which years are leap years matters for February 29, for date arithmetic, and for checking a span of dates. The rule is simple, but it has one important exception for century years.
A year is a leap year when it is divisible by 4 and not divisible by 100, unless it is divisible by 400. That single rule covers every case: 2020 is a leap year because 2020 / 4 = 505, while 1700 is not, because it ends in two zeros and 1700 / 400 leaves a remainder. The calculator reports the result as "Yes" for a leap year and "No" otherwise.
What is the leap year rule?
Two conditions decide the answer. First, the year must be evenly divisible by 4. Second, if the year ends in two zeros — a century year such as 1700 or 2000 — it must also be divisible by 400. A remainder of zero at each required division means the year is a leap year.
Written as a condition on the year :
The calculator applies exactly this test. Its underlying function returns the numeric code 0 for a leap year and 1 for a non-leap year, which the interface shows as "Yes" and "No".
| Year | Test from the rule | Result |
|---|---|---|
| 2020 | 2020 / 4 = 505, an integer | Yes, a leap year |
| 1700 | Ends in 00; 1700 / 400 = 4¼, a remainder | No, not a leap year |
| 2000 | Century year divisible by 400 | Yes, a leap year |
| 2024 | Divisible by 4 | Yes, a leap year |
| Calculator output code | Meaning |
|---|---|
| 0 | Yes, a leap year |
| 1 | No, not a leap year |
Worked example: checking 2020 and 1700
Take 2020. It does not end in two zeros, so only the first condition applies: 2020 / 4 = 505 with no remainder, so the calculator's test returns 0 and the answer is "Yes". Now take 1700. It ends in two zeros, so the century exception applies: 1700 / 400 = 4¼, which leaves a remainder. The test returns 1 and the answer is "No". Both results follow from the same rule; no other information is needed.
How do I check a single year with the calculator?
Enter the year in the field labeled "Your year" and read the result in the output field "Is it a leap year?". The answer appears as "Yes" or "No", matching the numeric codes in the table above. The same divisibility test runs for every year you enter, whether it is a recent year such as 2024 or a distant one.
Frequently Asked Questions
What does a remainder of zero tell me?
It means the division came out even. After dividing by 4, an integer result confirms the first condition of the rule. For a century year, an integer result after dividing by 400 is required as well.
What output code means "Yes"?
The code 0 means "Yes, a leap year". The code 1 means "No, not a leap year". Those are the two values the calculator's test can return.
Does the divisible-by-4 check apply to every year?
No. Century years — those ending in two zeros, such as 1700 — must also divide evenly by 400. That exception is why 1700 fails even though it is divisible by 4.
References
- Omni leap year calculator source: divisibility rule, output codes and calculator field labels.
- Gregorian calendar divisibility rule for identifying leap years.