{
    "name": "Leap Year Calculator",
    "url": "https://calculators.geekmidst.com/calculators/leap-year-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/leap-year-calculator.md",
    "category": "Date, time & lifestyle",
    "description": "Check whether a year is a leap year under the Gregorian rules, see why, find the previous and next leap years, and count leap years in a range.",
    "summary": "A year is a leap year if it is divisible by 4, except century years, which must also be divisible by 400. So 2000 was a leap year and 2100 will not be.",
    "also_called": [
        "Leap year checker",
        "Leap year date check"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "year",
            "label": "Year",
            "type": "number",
            "default": "2024"
        },
        {
            "name": "to_year",
            "label": "Count leap years up to",
            "type": "number",
            "default": "2100",
            "optional": true
        }
    ],
    "outputs": [
        {
            "key": "verdict",
            "label": "Answer",
            "format": "text"
        },
        {
            "key": "reason",
            "label": "Why",
            "format": "text"
        },
        {
            "key": "days_in_year",
            "label": "Days in the year",
            "format": "integer"
        },
        {
            "key": "february_days",
            "label": "Days in February",
            "format": "integer"
        },
        {
            "key": "previous_leap",
            "label": "Previous leap year",
            "format": "text"
        },
        {
            "key": "next_leap",
            "label": "Next leap year",
            "format": "text"
        },
        {
            "key": "leap_years_in_range",
            "label": "Leap years in the range",
            "format": "integer"
        }
    ],
    "formula": {
        "text": "Leap if (Y mod 4 = 0 and Y mod 100 ≠ 0) or Y mod 400 = 0;  Leap years up to Y = ⌊Y/4⌋ − ⌊Y/100⌋ + ⌊Y/400⌋",
        "variables": {
            "Y": "the year (Gregorian calendar)"
        }
    },
    "worked_example": {
        "inputs": {
            "year": "2024",
            "to_year": "2100"
        },
        "steps": [
            "2024 ÷ 4 = 506 with no remainder, and 2024 is not a century year, so it is a leap year.",
            "Leap years from 2024 to 2096 step by 4: (2096 − 2024) ÷ 4 + 1 = 19.",
            "2100 is divisible by 100 but not 400, so it is not added."
        ],
        "result": "2024 is a leap year with 366 days, and there are 19 leap years from 2024 to 2100 inclusive."
    },
    "interpretation": "Leap years keep the calendar in step with the solar year of about 365.2425 days. Birthdays on 29 February, interest calculated on actual days and annual day counts all depend on them.",
    "assumptions": [
        "Years use the Gregorian calendar, which most countries adopted between 1582 and the early 20th century."
    ],
    "limitations": [
        "Years before 1583 are not accepted because the Julian calendar used a different rule."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why is 2100 not a leap year?",
            "answer": "Adding a day every 4 years overshoots the solar year slightly, so three century years in every four skip the leap day. Only centuries divisible by 400, like 2000 and 2400, keep it."
        },
        {
            "question": "How many days are in a leap year?",
            "answer": "366, because February has 29 days instead of 28."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Day of the Week Calculator",
            "url": "https://calculators.geekmidst.com/calculators/day-of-the-week-calculator"
        },
        {
            "name": "Date Calculator",
            "url": "https://calculators.geekmidst.com/calculators/date-calculator"
        },
        {
            "name": "Age Calculator",
            "url": "https://calculators.geekmidst.com/calculators/age-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}