What the page tells you
Enter a year from 1 to 9999 and the page answers two things: whether it is a leap year, and how many days it contains. A leap year has 366 days because February gets a 29th day, and every other year has 365. The result matters whenever a calculation crosses February, such as annual interest on a day-count basis, a subscription that renews on a specific date, a birthday on February 29 or a software test for date handling. Putting the day count next to the true or false flag lets you copy the number straight into a formula without looking up the rule again.
The three-part rule
The Gregorian rule has three layers. A year divisible by 4 is a leap year. A year divisible by 100 is not, even though it is divisible by 4. A year divisible by 400 is a leap year again. In code: (year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0)). So 2024 and 2028 are leap years, 2023 and 2026 are not, 1900 and 2100 are not, and 1600, 2000 and 2400 are. The page evaluates exactly this expression, which means the answer for any year is determined by two remainders and nothing else.
The default example: 2000
The page starts with the year 2000, which returns true and 366 days. Many people expect a century year to be skipped, and for most centuries they would be right. The year 2000 is the exception because 2000 / 400 = 5 exactly. The previous century year, 1900, was not a leap year, so the cycle of leap days in the twentieth century ran 1904 through 1996 and then 2000. Software written in the 1990s sometimes got this wrong by treating all century years as ordinary, which is one reason 2000 became a standard test case for date code.
Other years worth testing
Check 1900 and the page returns false and 365, because it is divisible by 100 but not by 400. Check 2100 and the same happens, so February 2100 has 28 days. Year 2024 returns true and 366, and 2023 returns false and 365. Years such as 1600 and 2400 return true because they are divisible by 400. Leap years that are four years apart are the usual case, but the gap between 1896 and 1904 is eight years since 1900 was skipped. Knowing the gaps matters for projects that schedule work years ahead, such as a long-term maintenance calendar that includes February 29. The pattern repeats every 400 years, so the leap status of 2024 is the same as that of 2424 and 1624. That makes the rule easy to test by shifting a year up or down by 400 and checking that the answer does not change. A year ending in 00 is the only kind that needs the second test, which is why almost every year can be judged from its last two digits alone.
Why the rule exists
A solar year, the time between successive spring equinoxes, is about 365.2422 days. A calendar of 365 days falls behind by nearly a quarter day each year. The Julian calendar added a leap day every fourth year, giving an average of 365.25 days, which is slightly too long and drifted by roughly one day every 128 years. Pope Gregory XIII issued the reform in 1582, dropping three leap days every 400 years. The result is 97 leap years per 400 years, an average of 365.2425 days, and a cycle of 146,097 days that happens to be an exact number of weeks, 20,871.
February 29 in practice
People born on February 29 are sometimes called leaplings, and legal systems treat their birthdays in different ways in non-leap years. This calculator does not decide any legal question. The years between dates calculator on this site uses a stated product convention, in which a February 29 anniversary falls on February 28 in a non-leap year. If you rely on a date for something with legal effect, such as an age threshold or a contract term, check the rules of the relevant jurisdiction instead. The leap year result here is only a calendar fact: the year has a February 29, or it does not.
The calendar before the reform
Different countries adopted the Gregorian calendar at different times: parts of Catholic Europe in 1582, Britain and its colonies in 1752, Russia in 1918. Before each changeover, local dates followed the Julian rule, in which every fourth year was a leap year with no century exception. So 1700 was a leap year in the Julian calendar but is not in the Gregorian one. This page applies the Gregorian rule to every year in its range, which is called the proleptic Gregorian calendar. It is a consistent convention for computing, and it is the one used by modern date standards, but it will not always match an old local record.
Counting leap years in a range
Counting leap days across a period helps with long interest calculations and archival work. From 2000 through 2024 inclusive the leap years are 2000, 2004, 2008, 2012, 2016, 2020 and 2024, so seven. The twentieth century, 1901 to 2000, held 25 leap years because 2000 counts and 1900 falls outside the range. The twenty-first century, 2001 to 2100, holds 24, since 2100 is skipped. A quick method is to count the multiples of 4 in the range, subtract the multiples of 100, and add back the multiples of 400. Running a few boundary years through this page confirms the individual cases, which is a faster check than counting days across a long calendar span.
Limits and good practice
The input must be a whole number from 1 to 9999. The page does not accept year 0, negative years or dates, and it does not consider calendars other than the Gregorian one, such as the Hebrew, Islamic or Chinese lunisolar calendars, which have their own leap rules. If you are writing code, prefer the date library of your language over a hand-written test, but run a few known years here to check your implementation. A typical test set is 1900, 2000, 2023, 2024 and 2100. Save the year with any February result so that anyone reviewing the number can see which rule applied.