ForHosting KIT · Dates & time

Leap year checker

Enter a year and find out whether February has 29 days: 2024 is a leap year because it divides by 4 and not by 100, while 1900 is not and 2000 is. The reason names the rule that decided. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

A leap year checker answers one of the most common calendar questions: given a year, does February have twenty-nine days? Enter an integer Gregorian year and this tool returns a clear yes-or-no leap flag together with the exact divisibility reason—whether the year is divisible by four, by one hundred, and by four hundred—so you can see which branch of the Gregorian rule applied. Century years such as nineteen hundred fail the leap test even though they are divisible by four, while years such as two thousand pass because they are divisible by four hundred. The path is pure integer arithmetic with no network calls, no random seeds, and no dependence on the host clock or Date constructor.

What makes a Gregorian year a leap year

The proleptic Gregorian calendar inserts an extra day in February so the average year length stays close to the tropical year. The rule is taught as three nested conditions. First, if the year is not divisible by four, it is a common year and February has twenty-eight days.

Second, if the year is divisible by four but not by one hundred, it is a leap year and February has twenty-nine days—this covers ordinary leap years such as twenty twenty-four and twenty twenty-eight. Third, century years that are divisible by one hundred are common years unless they are also divisible by four hundred: nineteen hundred is not a leap year, while two thousand is.

That century exception is the part people forget most often, and it is why a leap year checker that only tests modulo four is wrong for production systems. Teachers can pair examples across all four outcomes: not divisible by four, divisible by four only, century common year, and century leap year.

Practical tips, limits, and related searches

Keep years inside the published range so four-digit Gregorian practice and sibling date tools stay consistent. When teaching or testing, keep a small known set: twenty twenty-four for an ordinary leap year, twenty twenty-three for a common year, nineteen hundred for a century common year, and two thousand for a century leap year, plus a deliberate non-integer failure such as a float year.

Round-trip checks are easy: recompute year modulo four, one hundred, and four hundred by hand and confirm that the three flags and the reason sentence match the documented branch order. This landing targets people searching for a leap year checker, is leap year calculator, or Gregorian divisible by four hundred online; it is not a day-of-week calculator, not a full ISO date validator, and not a business-day or age counter.

Prefer this capability when you already have a year and only need leap status and the divisibility explanation; if you have a full YYYY-MM-DD string and need the weekday, use the day of the week calculator instead. Year bounds stop at nine thousand nine hundred ninety-nine to keep the product surface aligned with other pure-parse date capabilities in this catalog.

Homework checks for leap-year rules

Students enter textbook years and compare hand-written leap status and century exceptions against a deterministic reason string before submitting calendar exercises.

Schedule and recurrence planning

Operations staff confirm whether a yearly template includes twenty-nine February before generating recurrence series or SLA calendars.

How do I know if a year is a leap year?

Under the Gregorian calendar a year is a leap year if it is divisible by 400, or divisible by 4 but not by 100. Otherwise it is a common year.

Is 1900 a leap year?

No. 1900 is divisible by 100 but not by 400, so it is a common year even though it is divisible by 4.

Is 2000 a leap year?

Yes. 2000 is divisible by 400, so the century exception does not apply and February has 29 days.

What if I send a non-integer year?

Years must be whole integers; floats and non-numeric strings are rejected.

Is the leap year checker free?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/date/is-leap-year

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/date/is-leap-year \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"year":2024}'
{
  "year": 2024
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.is_leap_year",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

year_min1
year_max9999
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Non-integer values are rejected with a clear invalid_input error instead of a silent false result.

What makes a Gregorian year a leap year

This capability applies the full rule tree and returns the boolean plus a human-readable reason that names which divisibility branch won.

How to call the API and what comes back

The value must be a whole number in the inclusive range from one through nine thousand nine hundred ninety-nine; decimal fractions, scientific notation strings, empty strings, and non-numeric types are rejected. Prefer sending a numeric year rather than a pre-formatted string when you control the client; string years are accepted only when they match a strict integer pattern without a decimal point. Send a JSON body with one required integer field named year, which may also be supplied under the aliases y or value. On success the response echoes year as an integer, sets is_leap_year, leap, and leap_year to the same boolean, sets divisible_by_4, divisible_by_100, and divisible_by_400 to the three modular flags used by the rule tree, and includes reason as a full English sentence explaining the branch, message as a short February-length summary, and steps as an ordered array that restates each modulo check. Failed validation—missing field, non-integer number, non-numeric string, or year outside the published range—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send bad years.

February edge-case fixtures for tests

Engineering teams build known leap and non-leap years for validators and UI calendars without depending on the host clock or Date constructor quirks.

Read the full KIT documentation →