Leap year calculator

The Gregorian rule — every four years, except centuries, except every four hundred years — gives a mean year of 365.2425 days.

Leap years in the range
25
= Exact Leap years
The year you checked is a leap year
0
Years in the range
101
Days in the range
36 890
Mean year length
365.247 525 days
Calendar drift against the tropical year
0:45:05
Show the working
  1. From year = 2000
  2. To year = 2100
  3. Year to check = 2100
  4. div4 = floor(2100/4) - floor((2000 - 1)/4) = 26
  5. div100 = floor(2100/100) - floor((2000 - 1)/100) = 2
  6. div400 = floor(2100/400) - floor((2000 - 1)/400) = 1
  7. Leap years in the range = 26 - 2 + 1 = 25
  8. Years in the range = 2100 - 2000 + 1 = 101
  9. The year you checked is a leap year = (mod(2100,4) == 0 && mod(2100,100) != 0) || mod(2100,400) == 0 ? 1 : 0 = 0
  10. Days in the range = 101 * 365 + 25 = 36 890
  11. Mean year length = 101 > 0 ? 36 890 / 101 : 0 = 365.248
  12. Calendar drift against the tropical year = (365.2425 - 365.242190) * 101 * 86400 = 2705.18

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • a year is a leap year if divisible by 4, except centuries, unless divisible by 400
    • that gives 97 leap years per 400, a mean year of 365.2425 days

    The tropical year is 365.242190 days, so the Gregorian calendar gains about one day every 3200 years.

    1900 was not a leap year and 2000 was, which is the rule that trips up spreadsheets and old software.

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library