Also available in: Español · Português · Français · العربية
Leap Year Calculator
Any year checked against the whole rule, with the part that decided it — and the one year every spreadsheet gets wrong on purpose.
What is a leap year?
A leap year is a year with 366 days instead of 365, the extra one being 29 February. They exist because the Earth takes about 365.242 days to go round the Sun, not a whole number, so a calendar of plain 365-day years drifts against the seasons by roughly a day every four years.
The rule most people know is “divisible by four”, and it is right about 96 years in every 100. The full rule has three parts: a year divisible by 4 is a leap year, unless it is divisible by 100, in which case it is not, unless it is also divisible by 400, in which case it is after all.
That is why 2000 was a leap year and 1900 was not, despite both being divisible by 4. It is also why 2100 will not be one — which catches people out, because everyone alive today has only ever seen the century exception fail to apply. The tool above tells you which of the three branches decided your year, rather than just yes or no.
How to use it
- Type any year. You get the answer, the part of the rule that produced it, and the leap years either side. The year before and after matter more than they look: across a skipped century the gap between leap years is eight years rather than four.
- Read the spreadsheet line. It tells you whether Excel agrees with the calendar for that year. For every year but one it does. The exception is worth knowing about if you ever do date arithmetic in a spreadsheet.
- Check the skipped centuries below. These are the years divisible by 4 that are still not leap years. If you are writing date code, they are the test cases worth having.
Why the rule has three parts
A year of exactly 365 days loses about a quarter of a day against the Sun, so adding one day every four years — the Julian rule — corrects most of it. But not all: the true figure is closer to 365.2422 than 365.25, so the Julian calendar overcorrected by about three days every four centuries. By the 1500s the date of the equinox had slipped by ten days, which is what prompted the Gregorian reform.
The fix was to remove three leap days per 400 years, by skipping the century years that are not divisible by 400. That leaves 97 leap years in every 400 rather than 100, and a mean calendar year of exactly 365.2425 days. The whole cycle is 146,097 days, which is also why the calendar repeats itself precisely every four centuries — a fact this site uses elsewhere for week numbering and for counting days between dates.
It is still not perfect. The mean tropical year is about 365.24219 days, so the Gregorian year is roughly 0.0003 days too long, and the calendar gains about a day every three thousand years. Nobody has decided what to do about that, and there is no rule in the standard for it. Anyone who tells you the leap year rule has a fourth part about 4000 is describing a proposal, not the calendar in use.
Every spreadsheet thinks 1900 was a leap year
Open a spreadsheet and ask it for 29 February 1900. You will get a valid date. That day never existed: 1900 is divisible by 100 and not by 400, so it was skipped, exactly like 2100 will be.
This is not an oversight and it is documented by Microsoft. Lotus 1-2-3 assumed 1900 was a leap year, which made its date handling simpler and harmed almost nothing. When Multiplan and then Excel arrived, they copied the assumption so that serial date numbers would stay compatible with Lotus and worksheets could move between the programs. The bug was inherited on purpose.
Microsoft has said plainly that it will not be corrected, because the fix would be worse than the fault: almost every date in every existing worksheet would shift by one day, formulas built on those dates would change their answers, and serial date compatibility with other programs would break. The defect they chose to keep is narrow — the WEEKDAY function returns wrong values for dates before 1 March 1900, and hardly anyone works with those.
The nuance worth carrying away is that spreadsheets are not generally wrong about leap years. Microsoft's own documentation points out that every other century year is handled correctly, using 2100 as the example. There is exactly one wrong year in the whole calendar, and we check that over eight centuries rather than assert it. If your dates all fall after February 1900 — and they do — the bug never touches you. It is a fossil, still lodged in the most widely used software on earth.
Honest limits
This calculator applies the Gregorian rule to every year you give it, including years before the Gregorian calendar existed. That is the proleptic Gregorian calendar, and it is what date libraries and this tool use, but it is not what people were actually using at the time. The reform was adopted in 1582 in Catholic Europe, in 1752 in Britain and its colonies, and as late as 1918 in Russia — so for a year before your country's switch, the historical answer may differ from the arithmetic one.
Those transitions also deleted days outright. Britain went from 2 September to 14 September 1752, and those eleven dates simply do not exist in British records. No leap year rule will tell you that; it is a fact about adoption, not about arithmetic.
The drift figure is a mean, not a schedule. The tropical year is not constant — it varies slightly with the definition used and changes slowly over millennia — so “about a day every three thousand years” is the right order of magnitude rather than a date you can put in a diary.
Why is it free?
Because it is arithmetic. There is no dataset behind this page and nothing to download — the rule is three lines of code, it runs in your browser, and nothing you type is sent anywhere.
So there is no account, no sign-up and nothing held back. The engine and its 2,447-assertion test suite are in the repository beside the page. Every year from 1600 to 2400 is checked against your own browser's calendar rather than against a second copy of the same rule, and the spreadsheet claim is verified from both sides — that 1900 disagrees, and that no other year in eight centuries does.