Leap Year Calculator
Check whether a year is a leap year and see how many days it contains.
Formula and sources updated · Data sources · 1View algorithm, constants and default inputs (JSON)
Day of the year to convert
About this calculator
A year is a leap year if it is divisible by four, except for century years, which must be divisible by 400. That rule keeps the calendar aligned with the seasons to within a day every 3,200 years. Advanced options convert a day number within the year to a date. Results include the applied Gregorian rule and the previous leap year when one exists.
Worked example
calculated with the default values below
Year 2,028 · Day of the year to convert 1 Leap year? Yes · Days in the year 366 days · Days in February 29 days · Next leap year 2,032 · Previous leap year 2,024 · Rule applied Divisible by 4 and not by 100 — leap year · What that day of the year is 2028-01-01
Method and assumptions
leap = ((y mod 4 = 0) ∧ (y mod 100 ≠ 0)) ∨ (y mod 400 = 0); days = {366, leap = 1; 365, leap = 0} The next leap year is found by counting upward from y + 1 until the rule is true; February has 29 days in a leap year, otherwise 28. A year is a leap year if it is divisible by four, except for century years, which must be divisible by 400. That rule keeps the calendar aligned with the seasons to within a day every 3,200 years. The references explain definitions and methods; any extra preset must be checked against the assumptions on this page.
Data sources
The references explain definitions and methods; any extra preset must be checked against the assumptions on this page.
Disclaimer
These calculators give general date results. Public holidays, working-day conventions and time-zone rules are set locally and change, so confirm against the official calendar for anything legally or contractually binding.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
leap = ((y mod 4 = 0) ∧ (y mod 100 ≠ 0)) ∨ (y mod 400 = 0); days = {366, leap = 1; 365, leap = 0}
- y
- calendar year (integer)
- leap
- leap-year flag (1 = leap year, 0 = common year)
- days
- days in the year
- next
- next year satisfying the rule
The next leap year is found by counting upward from y + 1 until the rule is true; February has 29 days in a leap year, otherwise 28.
Frequently asked questions
Why is 2028 a leap year but 2100 will not be?
The rule keeps years divisible by 4 as leap, except century years, which must also be divisible by 400. So 2028 qualifies with 366 days and a 29-day February, and the next leap year is 2032. By contrast 2100 is divisible by 100 but not 400, so it has only 365 days and a 28-day February despite being a multiple of 4.
Which inputs and limits apply to Leap Year Calculator?
Use the units shown beside each field. These are form limits, not recommended settings. Year: 1–9,999 leap = ((y mod 4 = 0) ∧ (y mod 100 ≠ 0)) ∨ (y mod 400 = 0); days = {366, leap = 1; 365, leap = 0} The next leap year is found by counting upward from y + 1 until the rule is true; February has 29 days in a leap year, otherwise 28. A year is a leap year if it is divisible by four, except for century years, which must be divisible by 400. That rule keeps the calendar aligned with the seasons to within a day every 3,200 years. The references explain definitions and methods; any extra preset must be checked against the assumptions on this page.
What is a complete worked example for Year = 2,028?
Inputs: Year = 2,028. Calculation: leap = ((y mod 4 = 0) ∧ (y mod 100 ≠ 0)) ∨ (y mod 400 = 0); days = {366, leap = 1; 365, leap = 0}. Results: Leap year? = Yes; Days in the year = 366 days; Days in February = 29 days; Next leap year = 2,032.