The leap year calculator above applies the complete Gregorian rule, not the simplified "divisible by four" version most people were taught at school. That shortcut is right roughly 96% of the time and wrong in exactly the cases that break spreadsheets, payroll schedules, and date arithmetic written in a hurry. Enter any year and the tool tells you whether it has 365 or 366 days, which day of the week 29 February falls on, and how many leap years sit inside a range you choose.
Arb Digital builds date logic into booking systems, subscription billing, and reporting dashboards, and the century exception is one of the most persistent sources of off-by-one-day bugs we see in client code. This page explains the rule in full so you can check a year by hand as easily as the calculator checks it for you.
What This Leap Year Calculator Does
It answers four questions at once. First, is the year you entered a leap year — a yes or no, with the specific branch of the rule that produced the answer stated underneath, so you can see whether the year passed on the divisible-by-four test or survived the century exception. Second, how many days that year contains: 365 or 366. Third, the nearest leap years on either side, which is useful when you are scheduling something that must land on a 29 February. Fourth, the total number of leap years between any two years you name, inclusive of both endpoints.
The weekday for 29 February is calculated with Zeller's congruence rather than the browser's built-in date object, so the answer is identical in every browser and unaffected by the visitor's local time zone. Time zone drift is a real problem with naive date code: a date created at midnight in one zone can silently roll back a day when rendered in another.
How to Use It
- Enter the year you want to check. Any year from 1583 onward works, because that is the first full year after the Gregorian calendar was introduced in October 1582.
- Read the headline answer. The large result says yes or no, and the line beneath it names the rule that decided it.
- Check the day count and the neighbouring leap years. The grid shows 365 or 366 days plus the leap year immediately before and after the one you entered.
- Set a range to count leap years. Enter a start and end year to see how many leap years fall inside that span — handy for interest, payroll, or age calculations spanning decades.
- Press Calculate to refresh every figure together, or Reset to return to the defaults.
The Formula: The Full Gregorian Rule
A year is a leap year if it is divisible by 4, except years divisible by 100, unless they are also divisible by 400. Written as a single test in plain terms: divisible by 400 means leap; otherwise divisible by 100 means not leap; otherwise divisible by 4 means leap; otherwise not leap. That three-step ladder is the whole rule, and every correct implementation is some rearrangement of it.
Work through the two famous cases. 1900 divides by 4, so the school rule says leap. It also divides by 100, which triggers the century exception, so it is not a leap year — unless it also divides by 400, and 1900 ÷ 400 = 4.75, so it does not. 1900 had 365 days. 2000 divides by 4, divides by 100, and also divides by 400 exactly (2000 ÷ 400 = 5), so the final clause rescues it: 2000 was a leap year with a 29 February. The next century year to be a leap year is 2400. 2100, 2200 and 2300 will all be ordinary 365-day years, which is a detail that matters for any long-range financial model.
Why the Rule Has Three Clauses at All
The complexity exists because the astronomical year does not divide neatly into whole days. A tropical year — one full cycle of the seasons — is roughly 365.2422 days, according to measurements maintained by the US National Institute of Standards and Technology. The Julian calendar handled this by adding one day every four years, which assumes the year is exactly 365.25 days. That overshoots by about 11 minutes annually.
Eleven minutes sounds trivial. Over sixteen centuries it accumulated into roughly ten days of drift, which is why the equinox had wandered noticeably away from its calendar date by the 1500s. The Gregorian reform fixed the accumulated error and changed the rule so it would not recur: dropping three leap days every four hundred years brings the average calendar year to 365.2425 days, within about 26 seconds of the true figure. That residual error takes something on the order of three thousand years to add up to a single day.
So the century exception is not an arbitrary quirk. It is the correction that keeps the calendar aligned with the seasons, and dropping it from your code reintroduces a bug that took astronomers centuries to notice.
The 29 February Edge Case
Dates that only exist every four years create a category of problem that has no single correct answer, only conventions. Someone born on 29 February 2000 has a birthday that does not appear on the calendar in 2025. Different systems resolve this differently: some treat 1 March as the anniversary, others treat 28 February, and legal definitions vary by jurisdiction. Neither choice is more mathematically valid than the other — what matters is picking one and applying it consistently, because mixing conventions inside one system produces records that disagree with each other.
The same issue affects any recurring date logic. A monthly subscription started on 31 January has to do something on 28 or 29 February, and a yearly one started on 29 February has to do something in non-leap years. Software that naively adds one to the year field will produce an invalid date. If you are working out how old someone is, our age calculator handles the leap-day case explicitly rather than silently rounding.
There is also a subtle counting trap: the number of days between two dates a year apart is 365 or 366 depending on whether a 29 February falls inside the interval, not on whether either endpoint year is a leap year. A span running from March 2024 to February 2025 contains no leap day even though 2024 is a leap year, because the leap day of 2024 had already passed. Our date difference calculator counts the actual days between two calendar dates and accounts for this automatically.
Where Leap Years Break Real Systems
The most common failure is a hardcoded 365 in an annualisation formula. Dividing an annual figure by 365 to get a daily rate is fine as an approximation, but if the same system then multiplies back up by the real number of days in a leap year, the totals will not reconcile. Financial systems solve this with an explicit day-count convention — actual/365, actual/360, or actual/actual — precisely so both sides of the calculation agree on how many days a year contains.
The second failure is day-of-year arithmetic. Code that converts a date to "day 60 of the year" and back again will land on 1 March in a normal year and 29 February in a leap year. Any logic that caches a day number across a year boundary needs to recompute rather than reuse.
The third is reporting comparisons. A leap year has one extra trading, staffing, or billing day than the year before it. Comparing annual totals without normalising for that gives a small phantom increase — roughly 0.27% — that has nothing to do with performance. Comparing February month-on-year has a much larger distortion: 29 days against 28 is a 3.6% difference in exposure. If you are comparing working days rather than calendar days, the business days calculator gives you the figure that actually matters for staffing.
Leap Years Are Not the Only Calendar Adjustment
Leap seconds are a separate mechanism entirely, and confusing the two is common. A leap day corrects the calendar against the orbital year. A leap second corrects atomic clock time against the Earth's slightly irregular rotation, and is announced only a few months in advance by the International Earth Rotation and Reference Systems Service. Leap seconds follow no formula — they are decided from observation, which is why no calculator can predict them. Leap days follow a fixed rule and can be projected indefinitely.
Daylight saving transitions are a third, unrelated adjustment: those shift clock time within a day rather than adding or removing days. If you are working across regions, the time zone converter handles that side, and the week number calculator covers ISO week numbering, which has its own 53-week years that do not line up with leap years at all.
Counting Leap Years in a Range
To count leap years between two years without listing them, count the multiples of 4, subtract the multiples of 100, then add back the multiples of 400. From 2000 to 2100 inclusive there are 26 multiples of 4, minus 2 multiples of 100 (2000 and 2100), plus 1 multiple of 400 (2000), giving 25 leap years. The calculator does this by direct iteration instead, which is slower but immune to the off-by-one errors that inclusive ranges invite.
This count matters more than it looks. Over a 40-year mortgage or a long service record, the difference between assuming 365-day years and counting real days is measured in weeks. Any model that projects daily accruals over decades should count actual days rather than multiply by 365.
Arb Digital builds booking systems, billing schedules, and reporting dashboards where calendar edge cases are handled properly rather than discovered in production.
Web Development Services Talk to Arb DigitalCommon Mistakes to Avoid
- Using only the divisible-by-four test — it gets 1900, 2100, 2200 and 2300 wrong, and those are exactly the years long-range models reach.
- Assuming every 400th year is the only exception — the rule is a ladder of three tests, and skipping the middle one gives the same wrong answers.
- Applying the Gregorian rule before 1582 — historical dates in the Julian calendar used the simple four-year rule, so pre-Gregorian answers are anachronistic.
- Confusing leap days with leap seconds — one follows a fixed formula, the other is announced from observation and cannot be predicted.
- Comparing February totals year on year without normalising — 29 days against 28 is a 3.6% difference in exposure before any real change is measured.
Related Free Tools From Arb Digital
Once you know which years are leap years, work out exact spans with the date difference calculator, find the weekday for any date with the day of the week calculator, count down to a future date with the days until date calculator, or check ISO week numbers with the week number calculator. Browse the full free online tools hub for the rest of the date and time set.
Frequently Asked Questions
1900 is divisible by 4, which passes the first test, but it is also divisible by 100, which triggers the century exception. It is not divisible by 400, so nothing rescues it. 1900 had 365 days and no 29 February.
2000 is divisible by 4 and by 100, so the century exception applies, but it is also divisible by 400 exactly. That final clause overrides the exception, so 2000 was a leap year with 366 days.
After 2024 the sequence continues 2028, 2032, 2036, 2040, 2044 and so on every four years, with no interruption until 2100, which will not be a leap year because it is a century year not divisible by 400.
Exactly 97. There are 100 multiples of 4, three of which are century years not divisible by 400, so three leap days are dropped. That gives an average calendar year of 365.2425 days.
There is no single correct answer. Some systems treat 28 February as the anniversary in non-leap years and others use 1 March, and legal definitions vary by jurisdiction. The important thing is applying one convention consistently.
No. A leap day keeps the calendar aligned with the Earth's orbit and follows a fixed rule. A leap second keeps atomic time aligned with the Earth's rotation, is decided from observation, and cannot be predicted in advance.
It applies the Gregorian rule to any year you enter, but dates before the Gregorian calendar was adopted in October 1582 used the Julian rule, where every fourth year was a leap year with no century exception.