ForHosting KIT · Dates & time

Zeller's congruence calculator

July 25, 2026 is a Saturday: Zeller's congruence adds 25, 20, 26, 6, 5 and −40 to reach 42, whose remainder after dividing by 7 is 0, the code for Saturday. Every step is shown, so students can redo it by hand. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Date
2026-07-25
You get
Year
2,026
Month
7
Day
25
Day of week
6

A Zeller's congruence calculator turns a single Gregorian ISO calendar date into the weekday name by running the classic modular arithmetic formula and showing every intermediate term. Enter a date as YYYY-MM-DD; the tool validates that the day exists on the calendar—including leap-year February rules—then applies Zeller's month shift for January and February, builds the century and year-of-century variables K and J, evaluates floor terms, reduces the sum modulo seven, and maps h onto Saturday-through-Friday names plus ISO weekday numbers.

What Zeller's congruence computes and why the steps matter

Zeller's congruence is a closed modular formula that maps a Gregorian calendar triple—year, month, and day of month—onto a weekday index without consulting a calendar table. In the common Gregorian form used here, the day of the month is q, the month is renumbered so that March is three and February is fourteen of the previous year, K is the year within the century, and J is the zero-based century floor of year over one hundred.

The formula is h equals the sum of q, the floor of thirteen times m plus one over five, K, the floor of K over four, the floor of J over four, and minus two times J, all taken modulo seven. The resulting h uses the Saturday-origin convention: zero means Saturday, one means Sunday, two means Monday, and so on through six for Friday.

That convention is not the same as ISO-8601 weekday numbers, so this tool also converts h into Monday-equals-one through Sunday-equals-seven and into a Sunday-origin zero-through-six index for callers that need those codings. Showing each floor term and the raw sum before the modulo is the pedagogical point: a learner can recompute ⌊13(m+1)/5⌋ by hand and assert that the published steps match. Classroom worksheets, algorithm textbooks, and coding-interview drills all hinge on that transparency.

The check path also rejects dates that are not real calendar days, because Zeller's formula assumes a genuine Gregorian day; feeding it 2023-02-29 would otherwise invent a weekday for a day that never existed.

Practical tips, limits, and related searches

Prefer sending a strict ISO string rather than free-form prose; the parser does not accept month names, slashes, or day-first European order. When teaching, pair a mid-year date such as 2026-07-25 with a January example so students see the year decrement and month-plus-twelve shift in the steps. Keep years inside the published one-to-nine-thousand-nine-hundred-ninety-nine band so century math stays simple and consistent with sibling date caps.

This landing targets people searching for a Zeller's congruence calculator, weekday algorithm step by step, or modular calendar formula online; it is not a full historical calendar converter for Julian-to-Gregorian transitions, not a business-day counter, and not a black-box day-of-week tool that hides the arithmetic. Prefer a simpler day-of-week calculator when you only need the name without Zeller intermediates; prefer this capability when the educational goal is the congruence itself.

Classroom worked examples for modular arithmetic

Teachers project a date, walk through each Zeller floor term in the steps array, and let students verify h and the weekday name before homework is submitted.

Algorithm documentation and interview prep

Candidates compare their hand-written congruence against published q, m, K, J, raw sum, and h without relying on language Date libraries.

What is Zeller's congruence?

A modular arithmetic formula that computes the weekday of a Gregorian date from day, renumbered month, year-of-century K, and century J, without looking up a calendar table.

What does h mean in the result?

h is the Zeller weekday index: 0 = Saturday, 1 = Sunday, 2 = Monday, …, 6 = Friday.

Why does January become month 13?

Zeller treats January and February as months 13 and 14 of the previous year so the formula's month term stays continuous from March through February.

What happens for 2023-02-29?

That day is not a valid Gregorian date (2023 is not a leap year).

Is the Zeller's congruence calculator 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/zeller-weekday

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/zeller-weekday \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-07-25"}'
{
  "date": "2026-07-25"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.zeller_weekday",
  "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.

Invalid strings, impossible months, and non-leap 29 February return a clear invalid_input error instead of a silent wrong answer.

How to call the API and what comes back

Years must lie between one and nine thousand nine hundred ninety-nine inclusive. The day must exist in that month under proleptic Gregorian leap rules—February has twenty-nine days only when the year is divisible by four, except century years that are not divisible by four hundred. Send a JSON body with one required string field: date (aliases iso_date, value, and day) in exactly YYYY-MM-DD form with a four-digit year and two-digit month and day. On success the response echoes the canonical date, year, month, and day, sets day_name and day_name_short to the English weekday labels, sets iso_weekday, day_of_week, and day_number to the ISO Monday-equals-one through Sunday-equals-seven code, sets weekday_0_sunday to the Sunday-origin index, and publishes the raw Zeller intermediates zeller_h, zeller_q, zeller_m, zeller_Y, zeller_K, and zeller_J together with formula, h_meaning, leap_year, message, and an ordered steps array that walks through the January–February shift, each floor term, the raw sum, and the final name mapping. Failed validation—missing fields, non-string values, wrong format, out-of-range years, impossible months, or impossible days—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

Cross-check a known Saturday or Monday against a printed calendar, then confirm that zeller_h and iso_weekday agree with the documented mappings. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately try 2023-02-29.

Unit tests for student calendar implementations

Generate known-good Zeller intermediates and invalid calendar-date rejections as deterministic fixtures for coding kata expected values.

Read the full KIT documentation →