Check leap year

Determine whether a Gregorian year contains 29 February.

freeworks offlinenothing uploaded
ToolLeap Year Checker
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A year is leap when divisible by four, except century years must also be divisible by 400. Passing the rule adds 29 February and raises the year from 365 to 366 days.

  • The arithmetic is proleptic Gregorian.
  • Locale and the current date do not affect the result.

Worked example

Check Leap Year
Check if 2024 is a leap year
Input
											2024
										
Output
												Year 2024: IS a leap year
Days in year: 366
Days in February: 29

Rule: Divisible by 4, except centuries unless also divisible by 400
  2024 % 4 = 0
  2024 % 100 = 24
  2024 % 400 = 24

Nearby leap years: 2016, 2020, 2024, 2028, 2032
											

When to use this

Date validators decide whether 29 February exists, billing schedules count days in a selected year, and calendar generators choose February’s length.

Edge cases

  • 1900 is divisible by four but is not leap because it is not divisible by 400.
  • 2000 is a century year and is leap because 400 divides it.
  • A Julian-calendar historical date follows a different rule and is outside this Gregorian result.

References