Leap Year? Check Any Year Instantly
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator tells you whether any given year is a leap year, and if so, how many days it has. You enter a year, and you get a clear yes/no answer along with the number of days in that year. The math behind it follows the standard Gregorian calendar rules used by most of the world today.
Formula
The Gregorian calendar rule for leap years is:
Leap year if (year divisible by 4) AND (year not divisible by 100) OR (year divisible by 400).
In symbols: (y % 4 == 0 && y % 100 != 0) || y % 400 == 0
- y – the year you are checking (integer, e.g., 2024)
- % – modulo operator, gives the remainder after division
- && – logical AND
- || – logical OR
The rule means a year is a leap year if it is divisible by 4, except that century years (like 1900) are not leap years unless they are also divisible by 400 (like 2000).
Worked Example
Using the default year 2024:
- Check divisibility by 4: 2024 ÷ 4 = 506, remainder 0 → divisible by 4.
- Check divisibility by 100: 2024 ÷ 100 = 20, remainder 24 → not divisible by 100.
- Since it is divisible by 4 and not by 100, the first condition is true, so 2024 is a leap year.
- Days in year = 365 + 1 = 366.
The calculator shows Leap year? = 1 (yes) and Days in year = 366.
Why Leap Years Exist
The Earth takes about 365.2422 days to orbit the Sun, not exactly 365 days. If we ignored that extra quarter-day, our calendar would drift: after 100 years, seasons would shift by about 24 days. To keep the calendar aligned with the seasons, we add an extra day every four years, making February 29th.
But the orbit is not exactly 365.25 days—it is slightly shorter. That is why the century rule exists. Adding a day every four years would add too much, so we skip leap years at the turn of each century, except when the century year is divisible by 400. This gives an average year length of 365.2425 days, very close to the actual 365.2422.
How the Rule Was Developed
The Julian calendar, introduced by Julius Caesar in 45 BCE, used a simple leap year every 4 years. That made the average year 365.25 days, which was slightly too long. By the 16th century, the calendar had drifted by about 10 days. In 1582, Pope Gregory XIII introduced the Gregorian calendar, which refined the rule by skipping leap years on century years not divisible by 400. This adjustment fixed the drift and is now the standard in most countries.
Common Misconceptions
A frequent mistake is thinking every year divisible by 4 is a leap year. That is true for most years, but not for century years like 1900 or 2100. The year 2000 was a leap year because it is divisible by 400. Another misconception is that leap years occur every 4 years without exception—that is true for the Gregorian calendar only with the century exception.
Some people also confuse leap years with leap seconds, which are added to atomic clocks to keep them aligned with Earth’s rotation. Leap seconds are irregular and unrelated to the calendar year.
How to Check Any Year
You can use the calculator above, or do it manually:
- Divide the year by 4. If there is a remainder, it is not a leap year.
- If the year is divisible by 4, check if it is a century year (ends in 00).
- If it is a century year, divide by 400. If divisible, it is a leap year; otherwise, it is not.
- If it is not a century year, it is a leap year.
For example, 2024 is a leap year, 1900 is not, 2000 is, and 2100 will not be.
Practical Uses
Knowing whether a year is a leap year matters for:
- Calculating date differences (e.g., days between two dates).
- Determining day of the week for a given date.
- Creating annual calendars or scheduling recurring events.
- Financial calculations involving annual interest or prorated amounts.
- Programming date functions in software.
If you are working with dates in code, most programming languages have built-in functions that handle leap years automatically, but understanding the rule helps when debugging or working with older systems.
Limitations and Edge Cases
The Gregorian calendar is not perfect—it still drifts by about one day every 3,300 years. Some proposed calendars, like the Revised Julian calendar, adjust the rule further, but they are not widely used.
For years before 1582, the Julian calendar was in use. If you are checking historical dates before that, the leap year rule was simply “divisible by 4.” This calculator uses the Gregorian rule, so it is accurate for modern dates and for historical dates if you assume the proleptic Gregorian calendar (extending the rule backward).
Also note that the year 0 does not exist in the standard calendar (1 BCE is followed by 1 CE). If you enter 0, the result may be odd, but the calculator treats it as a number, so 0 % 4 = 0, making it a leap year by the rule.
Frequently Asked Questions
Is 2024 a leap year?
Yes, 2024 is a leap year. It is divisible by 4 and not a century year, so February has 29 days and the year has 366 days.
Why is 1900 not a leap year?
1900 is divisible by 100 but not by 400. The rule says century years are leap years only if divisible by 400, so 1900 is not a leap year. The next century year that is a leap year is 2000.
What is the next leap year after 2024?
The next leap year is 2028, because it is divisible by 4 and not a century year. After that, 2032, 2036, and so on until 2100, which will not be a leap year.
How many leap years are there in a century?
Usually 24, but sometimes 25. In a 100-year span, there are 25 years divisible by 4, but one of them is a century year that is not divisible by 400, so that one is removed. For example, from 2001 to 2100, there are 24 leap years (2100 is not). However, from 2000 to 2099, there are 25 because 2000 is a leap year.
Do all countries use the Gregorian calendar?
No. Some countries use other calendars, such as the Islamic, Chinese, or Ethiopian calendars. However, the Gregorian calendar is the international standard for civil use, and most countries use it for official purposes.
What happens if you are born on February 29?
In non-leap years, people born on February 29 usually celebrate their birthday on February 28 or March 1, depending on local laws and personal preference. Legally, some jurisdictions define the birthday as February 28 for age-related purposes, while others use March 1.
Related
Formula used
in y | Year | - | 2024 | 1 out is_leap | Leap year? | - | (y % 4 == 0 && y % 100 != 0) || y % 400 == 0 | 0 out days | Days in year | - | 365 + ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.