Leap Year Calculations: Rules, Examples & FAQs
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 page explains how leap years are calculated, what you need to enter (a year), and what you get back (whether it is a leap year, plus the number of days in that year). The calculator below applies the standard Gregorian calendar rules so you can check any year from 1582 onward.
Formula
The Gregorian calendar leap year rule is:
A year is a leap year if it is divisible by 4, except if it is divisible by 100, unless it is also divisible by 400.
In symbols:
Leap = (y mod 4 = 0) AND (y mod 100 ≠0) OR (y mod 400 = 0)
Where y is the year (an integer), and mod means the remainder after division. For example, 2024 mod 4 = 0, so 2024 passes the first test.
Worked Example
Take the default year 2024:
- 2024 ÷ 4 = 506, remainder 0 → divisible by 4.
- 2024 ÷ 100 = 20, remainder 24 → not divisible by 100.
- Because it is divisible by 4 and not by 100, it is a leap year (no need to check 400).
So 2024 is a leap year with 366 days. The calculator gives the same result: is_leap = 1, days = 366.
Why Leap Years Exist
The Earth orbits the Sun in about 365.2422 days (the tropical year). A calendar of exactly 365 days drifts against the seasons by about 6 hours each year. Over a century, that adds up to 24 days – enough to move the equinoxes noticeably. To keep the calendar aligned, an extra day is added every four years, making the average year 365.25 days. That is still slightly longer than the true year (365.25 vs 365.2422), so the Gregorian calendar adds the century and 400-year exceptions to trim the excess.
The Gregorian Rules in Detail
The rules were introduced by Pope Gregory XIII in 1582 to fix the drift in the Julian calendar, which had a leap year every 4 years without exception. The Gregorian rules are:
- Divisible by 4 – most leap years (e.g., 2020, 2024, 2028).
- Divisible by 100 – not a leap year, unless…
- Divisible by 400 – then it is a leap year (e.g., 1600, 2000, 2400).
This makes the average year 365.2425 days, very close to the tropical year. The next century non-leap year is 2100; the next 400-year leap year is 2400.
Common Misconceptions
Many people think every year divisible by 4 is a leap year. That is true for most years, but not for century years. For example, 1900 was divisible by 4 and by 100, but not by 400, so it was not a leap year. Similarly, 2100 will not be a leap year. Another misconception is that leap years happen every 4 years without exception – the 400-year rule breaks that pattern. Also, the leap day is February 29, not December 31 or any other date.
How to Calculate Manually
If you do not have a calculator, you can check a year with simple division:
- Divide the year by 4. If the remainder is not 0, it is not a leap year.
- If the remainder is 0, divide the year by 100. If the remainder is not 0, it is a leap year.
- If the remainder is 0, divide the year by 400. If the remainder is 0, it is a leap year; otherwise it is not.
For example, 2000: divisible by 4, by 100, and by 400 → leap year. 1900: divisible by 4 and 100, but not 400 → not a leap year. 2023: not divisible by 4 → not a leap year.
Leap Years in Other Calendars
The Gregorian calendar is the international standard, but other calendars have their own leap rules. The Julian calendar, still used by some Orthodox churches, has a leap year every 4 years with no exceptions – so its calendar drifts slowly. The Hebrew calendar adds a leap month (Adar I) 7 times in a 19-year cycle. The Islamic calendar is lunar and has 11 leap years in a 30-year cycle, adding a day to the last month. The Chinese calendar adds a leap month roughly every 3 years. These are worth knowing if you work with historical dates or cultural events.
Practical Uses of Leap Year Knowledge
Knowing whether a year is a leap year matters for:
- Payroll – annual salaries divided by 366 vs. 365 affect daily rates.
- Interest calculations – some bonds and loans use actual day counts.
- Software – date libraries must handle February 29 correctly; bugs cause errors (e.g., the Y2K-style leap year bug in 2000).
- Historical research – converting dates between calendars requires leap rules.
- Planning – knowing a year has 366 days affects project timelines and event scheduling.
When reading a result, remember that the leap day is added to February, so February has 29 days in a leap year. The year has 366 days in total.
Limitations of the Formula
The formula applies to the Gregorian calendar, which was adopted at different times in different countries. For dates before 1582, or in countries that used the Julian calendar longer, the rule is different. Also, the formula assumes a year number as we use it today (e.g., 2024). It does not account for the fact that the tropical year itself changes slightly over millennia, but the Gregorian calendar’s error is only about 26 seconds per year, so it will take thousands of years to accumulate a day.
Frequently Asked Questions
Is 2000 a leap year?
Yes. 2000 is divisible by 4, by 100, and by 400. The 400-year rule makes it a leap year. This is often cited as the exception that proves the rule, because 1900 was not a leap year.
Is 2100 a leap year?
No. 2100 is divisible by 4 and by 100, but not by 400. So it will not be a leap year. The next century leap year after 2000 is 2400.
Why is February 29 the leap day?
The ancient Roman calendar originally had February as the last month, and the extra day was added there. When the Julian calendar was reformed, the leap day remained in February. The tradition carried into the Gregorian calendar.
What happens if I was born on February 29?
In non-leap years, people born on leap day typically celebrate on February 28 or March 1, depending on local law or personal preference. Legally, some jurisdictions define the birthday as March 1 in non-leap years, but there is no universal rule.
How often does a leap year occur?
On average, every 4 years, but the century rule makes it 97 leap years per 400 years. That is an average of one leap year every 4.12 years. The last leap year was 2024; the next is 2028.
Do all countries use the Gregorian leap year rule?
Most countries use the Gregorian calendar for civil purposes, so yes. Some countries also use other calendars for religious or traditional purposes, but the Gregorian rule is the international standard for dates and business.
Related
Formula used
in y | Year | - | 2024 | 1582 out is_leap | Leap year? | - | (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) ? 1 : 0 | 0 out days | Days in year | days | is_leap * 366 + (1 - is_leap) * 365 | 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.