Leap Years: The Rule, the Exception, and the Exception to the Exception
Published 6/6/2025 · 15 min read · Everyday calculators
Lena Hoffmann — Science & education writer at OneKitly
Mathematics · Physics
Checked against 5 sources
A year is a leap year if it is divisible by 4, unless it is divisible by 100, unless it is also divisible by 400. So 2024 and 2000 are leap years, 1900 and 2100 are not, and 2026 is not. The three clauses exist because the Earth does not cooperate: the mean tropical year is about 365.242190 days, not the 365.25 the Julian calendar assumed. That assumption over-counts by 0.007810 days a year, which is one full day every 128 years — and by 1582 the calendar had slipped roughly ten days from the seasons it was meant to track. Gregory's correction drops three leap days from every four centuries, so a 400-year cycle holds 97 leap years and exactly 146,097 days. Divide: the mean Gregorian year is 146,097 ÷ 400 = 365.2425 days, which overshoots the tropical year by only 0.000310 days, or one day in roughly 3,226 years. The cycle has a second, quieter property: 146,097 ÷ 7 = 20,871 exactly, so the Gregorian calendar contains a whole number of weeks and repeats, weekday for weekday, every 400 years. Leap seconds are a separate mechanism entirely, and they are being retired.
Divisible by four, except centuries, except centuries divisible by four hundred. The three-line rule exists because the tropical year is not 365.25 days, and the arithmetic behind it explains ten deleted days in 1582 and a calendar that repeats exactly every 400 years.
The rule in three lines, and why one line is not enough
Divisible by 4 is a leap year. Divisible by 100 is not. Divisible by 400 is, after all. Applied in that order the test never needs a fourth clause, and it decides any year in three integer divisions. The table above runs it on seven years and shows where the intuition breaks: everyone gets 2024 right and almost everyone gets 1900 wrong, because the first clause is the one people remember. Anyone born after 1900 has lived through exactly one century year, and it was 2000 — the one that behaves like an ordinary leap year. A whole generation of software was written by people who had never seen the century exception fire, which is why a well-documented crop of programs mishandled February 29, 2000, and why the next real test, 2100, will find plenty of code that still assumes divisible-by-four is the whole story.
The order of the clauses matters, and writing them in the wrong order produces a test that is right most of the time — the worst possible failure mode. Check divisibility by 400 first and return true, then check 100 and return false, then check 4. Reversing the last two turns 2000 into a common year. If you would rather not think about it at all, the arithmetic collapses into a single expression: a year is a leap year exactly when it is divisible by 4 and either not divisible by 100 or divisible by 400. Anything more elaborate is a bug waiting to be found, and anything simpler is wrong once a century.
The tropical year is not 365.25 days — do the arithmetic
The mean tropical year — the average interval between one northward equinox and the next — is about 365.242190 days at the current epoch. The Julian calendar assumed 365.25 by inserting one leap day every four years without exception. The difference is 365.25 − 365.242190 = 0.007810 days per year. Invert it: 1 ÷ 0.007810 = 128.0, so the Julian calendar gains one full day on the seasons every 128 years. That is slow enough to be invisible in a lifetime and fast enough to be catastrophic over a millennium. Take the Council of Nicaea in 325, which fixed the calculation of Easter against a March 21 equinox: from 325 to 1582 is 1,257 years, and 1,257 × 0.007810 = 9.82 days. That is the ten days Gregory's bull deleted, computed from first principles rather than looked up.
The correction is elegant because it is arithmetic, not astronomy. Drop three leap days from every four centuries and a 400-year block contains 97 leap years instead of 100. Count the days: 303 common years at 365 plus 97 leap years at 366 is 146,097 days. Divide by 400 and the mean Gregorian year is exactly 365.2425 days. Compare that with 365.242190 and the residual is 0.000310 days a year, which is one day every 3,226 years — twenty-five times better than Julian, from a rule you can apply in your head. Nobody has bothered to legislate the next correction, and there is no need: the tropical year itself is slowly changing, so a rule fixed today for the year 5000 would be guessing.
October 1582, and the two centuries of disagreement that followed
Fixing the rule fixed the future but not the past, so the accumulated ten days had to be removed by hand. In the Catholic states that adopted the reform immediately, Thursday October 4, 1582 was followed by Friday October 15. The weekday sequence was deliberately preserved — Thursday to Friday, unbroken — because the seven-day cycle had never been the thing that was wrong. Only the date labels moved. Anyone computing a duration across that gap in Italy, Spain, Portugal or Poland has to subtract ten days that no one lived through, and the historical date libraries that get this right are noticeably rarer than the ones that pretend the Gregorian rule always applied.
The adoption dates then scattered across three and a half centuries, and the number of days deleted grew with the wait. Britain and its colonies switched under the Calendar (New Style) Act 1750: Wednesday September 2, 1752 was followed by Thursday September 14, eleven days gone, because by then the Julian calendar had drifted a further day. Russia held out until 1918, when the Julian dates of February 1 to 13 were dropped and January 31 was followed directly by February 14 — thirteen days. Greece went last among European states, in 1923. The practical consequence for anyone handling historical records is that a date alone is ambiguous: the same event in 1750 carries two different dates depending on whether the source was written in London or in Paris, which is why archival sources annotate them Old Style and New Style.
146,097 days is exactly 20,871 weeks — so the calendar repeats
This is the property nobody designed and everybody benefits from. A 400-year Gregorian cycle is 146,097 days, and 146,097 ÷ 7 = 20,871 with no remainder. Because the cycle contains a whole number of weeks, every date returns to the same weekday after 400 years. August 22, 2426 will fall on the same day of the week as August 22, 2026. So will every other date, which means the entire calendar — leap years, weekdays, the lot — is periodic with period 400. It also means the distribution of weekdays across dates is not uniform, because 400 is not divisible by 7. Count the 13th of every month across one cycle: 4,800 occurrences, of which Friday takes 688, more than any other weekday, against 684 for Thursday and Saturday. The superstition has a genuine arithmetic backing, which is the only thing about it that is true.
Two useful things follow. First, any correct implementation can be tested exhaustively: there are only 400 distinct year patterns, and a loop over 146,097 days covers every case a Gregorian date routine will ever face, including all the century behaviour. Nobody needs to sample. Second, February 29 is not evenly distributed either. There are 97 of them per cycle, so an average gap of 4.12 years, and the gaps are not all four: from February 29, 1896 the next was February 29, 1904, an eight-year wait, because 1900 was skipped. The same eight-year gap will happen again between 2096 and 2104, which will surprise a generation of leap-day celebrants who have known nothing but a reliable four-year rhythm.
February 29 birthdays, and what the law actually says
Someone born on February 29 has a birthday in only 97 years out of every 400. In the other 303 the date does not exist, and every system that has to age them up must decide whether their legal birthday falls on February 28 or on March 1. Jurisdictions genuinely differ, and the choice has consequences: coming of age, a licence renewal, a pension entitlement or an insurance band can all turn on one day. The safe engineering answer is not to invent a rule but to store the birth date exactly as February 29 and apply whichever convention the applicable law specifies, keeping the two decisions separate. Never store February 28 as a substitute — that discards the information and there is no way to recover it later.
The same discipline applies to contracts and subscriptions. A twelve-month term that starts on February 29, 2024 ends on February 28, 2025 under clamping, and a customer who reads the renewal date as March 1 is not being unreasonable — the calendar genuinely offers no correct answer. Write the convention into the terms rather than leaving it to whatever the billing library happens to do. Anniversary dates that fall on the 29th, 30th and 31st of any month deserve the same treatment; February 29 is only the case that gets noticed because it is the one that fails four years out of five instead of a few months out of twelve.
Leap seconds are a different mechanism — and they are being retired
Leap days correct the calendar against the Earth's orbit. Leap seconds correct a clock against the Earth's rotation, which is a different quantity, measured differently, and drifting for different reasons. UTC is generated by atomic clocks and is therefore uniform; UT1 tracks the actual rotation of the planet, which is irregular. Since 1972 the two have been kept within 0.9 seconds of each other by inserting a leap second when needed, 27 times in total. The last insertion was on December 31, 2016, and the difference TAI − UTC has stood at 37 seconds since January 1, 2017. IERS Bulletin C confirmed no leap second for either June or December 2026, so the gap is now approaching a decade.
The mechanism is on its way out. Resolution 4 of the 27th General Conference on Weights and Measures, adopted in 2022, decided that the maximum permitted value of UT1 − UTC will be increased in or before 2035, and asked the CIPM to bring a concrete new tolerance, an implementation plan and a review timetable to the 28th CGPM in 2026. In practice that means the leap second as a recurring operational event is ending, because a wider tolerance removes the need to insert one for a century or more. It also means the two mechanisms should never be confused in your code: leap days are deterministic and computable centuries ahead from three divisions, while leap seconds were announced case by case, at most six months in advance, by an observation-driven bulletin. Anything that needs the second kind must fetch a table; anything that needs the first kind only needs the rule.
| Year | Divisible by 4 | Divisible by 100 | Divisible by 400 | Leap year? |
|---|---|---|---|---|
| 1900 | Yes | Yes | No | No — the century exception |
| 1996 | Yes | No | No | Yes — the plain rule |
| 2000 | Yes | Yes | Yes | Yes — the exception to the exception |
| 2024 | Yes | No | No | Yes |
| 2026 | No | No | No | No |
| 2100 | Yes | Yes | No | No — the next skipped one |
| 2400 | Yes | Yes | Yes | Yes |
Frequently asked questions
- Is 2026 a leap year?
- No. 2026 is not divisible by 4, so the test stops at the first clause and February 2026 has 28 days. The nearby leap years are 2024 and 2028. Applying the full test takes three checks in this order: divisible by 400 means yes, otherwise divisible by 100 means no, otherwise divisible by 4 means yes. On that basis 2000 was a leap year and 1900 was not, which is the single case that trips people up, because everyone alive today has only ever seen the century year that behaves like an ordinary one. The next century year to be skipped is 2100, and February 2100 will have 28 days despite 2100 being divisible by 4. Any code that still tests only divisibility by 4 will be wrong that year, and there is a lot of it.
- Why is 1900 not a leap year but 2000 is?
- Because a leap day every four years is slightly too many, and the century rule takes some of them back. The mean tropical year is about 365.242190 days, while the Julian rule assumed 365.25 — an over-count of 0.007810 days a year, or one whole day every 128 years. Dropping three leap days from every four centuries brings the average down to exactly 365.2425 days, since a 400-year cycle then holds 97 leap years and 146,097 days, and 146,097 ÷ 400 = 365.2425. The century years that get dropped are the ones not divisible by 400, so 1700, 1800, 1900 and 2100 are common years while 1600, 2000 and 2400 remain leap years. The remaining error is 0.000310 days a year, about one day in 3,226 years, which is why nobody has needed to add a fourth clause.
- Why were ten days deleted in October 1582?
- To undo drift that had already accumulated, since changing the rule only fixed the future. The Julian calendar gained one day on the seasons every 128 years. Measured from the Council of Nicaea in 325, which anchored the calculation of Easter to an equinox on March 21, the interval to 1582 is 1,257 years, and 1,257 × 0.007810 = 9.82 days — so about ten days had to come out. In the states that adopted the reform immediately, Thursday October 4, 1582 was followed by Friday October 15. The weekday sequence was preserved deliberately: the seven-day cycle was never the part that was wrong, so only the date labels moved. Countries that adopted later had to delete more days, because the drift kept accumulating while they waited.
- Does the calendar really repeat every 400 years?
- Yes, exactly, and it is a consequence of one division. A 400-year Gregorian cycle contains 97 leap years, which is 303 × 365 + 97 × 366 = 146,097 days, and 146,097 ÷ 7 = 20,871 with no remainder. Because the cycle is a whole number of weeks, every date returns to the same weekday after 400 years: August 22, 2426 is the same weekday as August 22, 2026, and so is every other date. The whole calendar — leap years, weekdays, month lengths — is periodic with period 400. One side effect is that weekdays are not evenly distributed across dates, since 400 is not a multiple of 7: across one cycle the 13th of the month falls on a Friday 688 times out of 4,800, more often than on any other weekday. Another is that a date library can be tested exhaustively rather than sampled, because 146,097 days covers every case that exists.
- Are leap seconds the same thing as leap days?
- No, and confusing them is a common source of bad assumptions. Leap days keep the calendar aligned with the Earth's orbit and follow a fixed arithmetic rule you can evaluate centuries ahead. Leap seconds kept atomic time, UTC, within 0.9 seconds of UT1, which tracks the Earth's irregular rotation, and they could not be predicted — the IERS announced each one at most about six months in advance in Bulletin C. Since 1972 there have been 27 insertions; the last was on December 31, 2016, and TAI − UTC has been 37 seconds since January 1, 2017. Bulletin C confirmed none for June or December 2026. The mechanism is also on its way out: Resolution 4 of the 27th CGPM, adopted in 2022, decided that the maximum permitted value of UT1 − UTC will be increased in or before 2035, with the concrete new value to be agreed at the 28th CGPM in 2026.
- When do people born on February 29 celebrate their birthday?
- Socially, on whichever of February 28 or March 1 they prefer; legally, on whichever the applicable jurisdiction specifies, and jurisdictions genuinely differ. The date exists in only 97 years out of every 400, so in the other 303 something has to substitute for it, and the choice can matter for coming of age, licence renewals, insurance bands and pension entitlements. If you are building a system, store the birth date exactly as February 29 and apply the legal convention as a separate, configurable step — never overwrite the stored date with February 28, because that discards information you cannot recover. Note too that the gap between leap days is not always four years: the last one to run to eight years was 1896 to 1904, and the next will be 2096 to 2104, since 2100 is skipped by the century rule.
Articles you may find interesting
All guides →Related tools
Sources
- BIPM — Resolution 4 of the 27th CGPM (2022) — on the use and future development of UTC
- IERS — Bulletin C — leap second announcements
- U.S. Naval Observatory — Astronomical Applications Department — the tropical year and calendar fundamentals
- ISO — ISO 8601-1:2019 — Date and time: representations for information interchange
- UK Parliament — Calendar (New Style) Act 1750
Spotted a mistake in this article?