Skip to content
Date & Time

Leap Year Calculator

A Gregorian leap year is one divisible by 4, except years divisible by 100, unless they are also divisible by 400. That is why 1900 was a common year and 2000 was a leap year. The extra day keeps the calendar aligned with the solar year, which is about 365.2422 days long.

By Updated Runs in your browser — nothing is uploaded

Input · parameters

Is 2026 a leap year?

No

Not divisible by 4 — an ordinary common year.

Days in the year
365
29 February falls on
there is no 29 February
Next leap year
2028
Previous leap year
2024
Leap years so far this century
6
On this page
  1. The rule has three clauses, not one
  2. Why the correction exists
  3. The changeover was not simultaneous
  4. Leap seconds are a different problem
  5. Where leap years break software
  6. Other calendars solve it differently
  7. Living with 29 February

The rule has three clauses, not one

Most people know the first clause and stop there. The full rule:

divisible by 4          → leap year
  unless divisible by 100  → not a leap year
    unless divisible by 400  → leap year after all

So 2024 is a leap year on the first clause. 1900 was not, caught by the second. 2000 was, rescued by the third — which is why almost nobody alive has seen the exception actually fire. The next time it does is 2100, and it will surprise a great deal of software.

The arithmetic behind the clauses is a matter of averaging. Over 400 years the rule produces 97 leap years rather than 100, giving a mean calendar year of:

(400 × 365 + 97) ÷ 400 = 365.2425 days

against a mean tropical year of about 365.2422 days. The residual error is roughly 0.0003 days a year — one day in something over 3,000 years. Nobody has legislated a correction for it, and there is no need to yet.

Why the correction exists

The Earth's orbit does not divide into whole days. A year of exactly 365 days runs fast against the seasons by almost a quarter of a day annually, which is a month of drift per century and a season of drift over four. A calendar that does that stops being able to say when to plant.

The Julian calendar, from 46 BC, fixed the obvious part: one extra day every fourth year, with no exceptions, for an average year of 365.25 days. That is much better and still not right. It over-corrects by about 11 minutes a year.

Eleven minutes is nothing. Over sixteen centuries it is ten days, and by the 1500s that is exactly what had accumulated: the spring equinox had slid from 21 March to 11 March, dragging the calculation of Easter with it. Since Easter is fixed relative to the equinox, the church had a liturgical problem that was also an astronomical one.

The Gregorian reform of 1582 did two things. It deleted the accumulated ten days in one step, so that 4 October was followed by 15 October. And it added the century clauses, which remove three leap days every four hundred years and bring the average year close enough to the real one that the problem does not recur on any human timescale.

The changeover was not simultaneous

The reform was promulgated by a papal bull, which meant Catholic Europe adopted it immediately and everyone else took their time — in some cases centuries.

1582 — Spain, Portugal, Poland, Italy, and the Catholic states.

1752 — Britain and its colonies, including what became the United States. The day after Wednesday 2 September was Thursday 14 September, eleven days having accumulated by then. The Act also moved the start of the legal year from 25 March to 1 January.

1918 — Russia, shortly after the revolution, which is why the October Revolution took place in November by the calendar used elsewhere.

1923 — Greece, the last European country to switch.

The practical consequence for anyone reading old records is that a date in the gap is ambiguous unless the source says which system it used. Historians mark them Old Style and New Style for exactly this reason, and a birth date recorded in England in 1700 is not the same day as the same date recorded in France.

The tool above applies the modern rule to any year, including those before 1582. That is a proleptic Gregorian calendar: arithmetically consistent, and not a description of what a calendar of the day would have shown. It flags the case rather than leaving it implicit.

Leap seconds are a different problem

The two get conflated constantly and share nothing but the word.

A leap year corrects the calendar against the Earth's orbit. It follows a fixed rule, it is known thousands of years ahead, and any program can compute it.

A leap second corrects clocks against the Earth's rotation, which is irregular. Tidal friction slows it gradually; redistribution of mass in the core and oceans nudges it both ways unpredictably. Because the drift cannot be predicted, leap seconds are not on a schedule: the IERS announces one a few months in advance when the accumulated difference between atomic time and rotational time approaches a threshold.

That unpredictability is why leap seconds break software in ways leap years do not — a system cannot precompute them — and it is a large part of why a decision has been taken internationally to stop inserting them by 2035.

Where leap years break software

Every few years, on 29 February, a wave of outages arrives. The causes repeat.

Adding a year by incrementing the year field. Take 29 February 2024, add one to the year, and you have 29 February 2025, which does not exist. Depending on the language it becomes 1 March, throws, or silently produces a corrupt value. Date libraries clamp to 28 February; naive arithmetic does not.

Day-of-year offsets. Code that treats day 60 as 1 March is right for three years in four.

The century rule. Systems written with year % 4 alone were correct throughout 1901-2099, a window that covers the entire working life of most software ever written. They will be wrong in 2100, and the flaw is invisible until then.

Excel's deliberate 1900 bug. Excel's serial dates include a 29 February 1900 that never existed, inherited for compatibility with Lotus 1-2-3 and documented by Microsoft as intentional. Date differences spanning 1 March 1900 are off by one day, and files exchanged between Excel and systems without the quirk disagree about anything that old.

The general lesson is the same one that applies to time zones: do not implement calendar arithmetic. Use the platform's date library, which already knows about all of this and has been corrected by people who found the edge cases the hard way.

Other calendars solve it differently

The Gregorian answer — one extra day, occasionally withheld — is not the only one, and the alternatives are a useful reminder that a leap rule is a design decision rather than a fact of nature.

Lunisolar calendars insert a whole month. The Hebrew calendar keeps its months tied to the moon and its year tied to the seasons by adding a thirteenth month, Adar I, in seven years out of every nineteen. Chinese and several other traditional calendars use the same idea with different arithmetic. The correction is much larger and much less frequent than a leap day.

Purely lunar calendars do not correct at all. The Islamic calendar runs twelve lunar months and lets the year drift against the seasons by about eleven days annually, which is why Ramadan moves steadily through the solar year over a 33-year cycle. That is deliberate, not an oversight.

Some institutions kept the Julian rule. Several Orthodox churches still calculate their liturgical calendar the Julian way, which is why Orthodox Christmas falls on 7 January in Gregorian terms — the accumulated difference now stands at thirteen days, and it will grow to fourteen in 2100 when the Gregorian calendar skips a leap year and the Julian one does not.

Living with 29 February

Birthdays. Roughly one person in 1,461 is born on 29 February. In non-leap years the anniversary is observed on 28 February or 1 March, and which one is legally correct depends on the jurisdiction: several common-law systems treat a person as attaining an age at the start of the anniversary day, which lands on 1 March, while particular statutes name 28 February instead. Most people simply choose.

Contracts and subscriptions. An annual term starting 29 February has no obvious anniversary. Well-drafted agreements say what happens; systems that do not, quietly pick one, and the choice usually surfaces as a billing dispute four years later.

Pay and interest. A leap year has 366 days, so anything calculated per day earns or costs one extra day of it. On a 365-day convention that day is simply not counted, which is one of several places where the day count basis in a contract matters more than it looks.

Common questions

Frequently asked questions

What is the full leap year rule?

A year is a leap year if it is divisible by 4, unless it is divisible by 100, in which case it is not — unless it is also divisible by 400, in which case it is. 1996 and 2024 are leap years by the first clause, 1900 was excluded by the second, and 2000 was restored by the third. The next exception is 2100, which will not be a leap year.

Why is a correction needed at all?

Because the solar year is not a whole number of days. It runs about 365.2422 days, so a fixed 365-day calendar drifts by nearly a quarter of a day annually. Adding a day every fourth year over-corrects slightly, at 365.25 days per year, and the century rules remove that surplus. What remains drifts by roughly one day in 3,000 years.

What was wrong with the Julian calendar?

It applied the four-year rule with no exceptions, making the average year 365.25 days — about 11 minutes too long. That is small annually and large over centuries: by the 1500s the calendar had slipped ten days against the seasons, moving the equinox and with it the calculation of Easter. The Gregorian reform of 1582 dropped those ten days and added the century rules to stop the drift recurring.

Do different countries have different leap years?

Not now, but the changeover was staggered by centuries. Catholic Europe adopted the Gregorian calendar in 1582; Britain and its colonies waited until 1752, when the day after 2 September was 14 September; Russia changed in 1918 and Greece in 1923. Dates in that gap are ambiguous unless the source says which calendar it used, which is why historical records are sometimes marked Old Style or New Style.

Are leap seconds the same thing?

No, and they are unrelated in mechanism. A leap year corrects the calendar against the Earth’s orbit; a leap second corrects clocks against the Earth’s rotation, which is irregular and slowing unevenly. Leap seconds are announced by the IERS a few months ahead rather than following a rule, and a decision has been taken to stop inserting them by 2035.

When do people born on 29 February have a birthday?

Legally it depends on the jurisdiction, and the two common answers are 28 February and 1 March. In common-law countries a person is generally treated as attaining an age at the start of the anniversary day, which places it on 1 March in a non-leap year; some statutes specify 28 February instead. Socially most people simply pick one. The date returns every four years, with the century exceptions applying as usual.

Why do spreadsheets think 1900 was a leap year?

Because Excel’s serial date system deliberately includes a 29 February 1900 that never existed, for compatibility with Lotus 1-2-3, which had the bug first. Microsoft documents it as intentional: fixing it would shift every date before 1 March 1900 in every existing file. The consequence is that date arithmetic spanning that boundary is off by one day, which almost never matters and occasionally does.

References

Sources

The formulas and reference ranges on this page come from the following publications. Where a source has been revised, we cite the current edition.

  1. 1Introduction to Calendars — the Gregorian calendar and its leap year rulesUS Naval Observatory, Astronomical Applications Department
  2. 2Calendar (New Style) Act 1750 — Britain’s adoption of the Gregorian calendarUK Government (legislation.gov.uk)
  3. 3Excel incorrectly assumes that the year 1900 is a leap yearMicrosoft Learn
  4. 4Earth orientation, UT1 and the announcement of leap secondsInternational Earth Rotation and Reference Systems Service (IERS)

Keep going