Zeller's Congruence Calculator

Enter a date to compute its weekday with Zeller's formula.

Result

Sunday
1

How it is calculated

The date is read as YYYY-MM-DD and must be a real calendar date typed with a four-digit year, two-digit month and day. Let q be the day, m the month and Y the year. January and February are counted as months 13 and 14 of the previous year. With K = Y mod 100 and J = Y div 100, h = (q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J) mod 7. Here h = 0 means Saturday, 1 Sunday, 2 Monday and so on to 6 Friday, and the tool translates that into the weekday name. The Gregorian rules are always used, even for dates before the calendar was adopted, so there is no Julian mode and the results for old dates are for the proleptic Gregorian calendar, not for what a local record may show.

Worked example

Take 1969-07-20. Here q = 20, m = 7 (no shift needed), Y = 1969, so K = 69 and J = 19. Terms: ⌊13 × 8 ÷ 5⌋ = 20, ⌊69 ÷ 4⌋ = 17, ⌊19 ÷ 4⌋ = 4, 5 × 19 = 95. Sum: 20 + 20 + 69 + 17 + 4 + 95 = 225. Then 225 mod 7 = 1, since 7 × 32 = 224. An h of 1 stands for Sunday, so 20 July 1969 was a Sunday.

Try this example →

Common mistakes

  • Reading h as the ISO weekday number: in the formula 0 is Saturday and 1 is Sunday, so h = 2 is Monday and not Tuesday.
  • Forgetting that January and February belong to the previous year in the formula; for 1 January 2000 it uses year 1999 and month 13, which is why the results differ from a naive calculation.
  • Typing the date as DD-MM-YYYY or MM/DD/YYYY: only YYYY-MM-DD is accepted, and impossible dates like 2023-02-30 give no result.
  • Using the answer for dates in countries that still used the Julian calendar: the tool applies Gregorian rules, so those dates can be off by several days from local records.
  • Entering a one-digit month or day such as 2026-7-16; it needs 2026-07-16.

About this calculator

Zeller's congruence is a formula devised by German mathematician Christian Zeller in the 19th century that computes the day of the week for any Gregorian calendar date using only arithmetic on the day, month and year. The calculation treats January and February as months 13 and 14 of the previous year, then combines the day, an adjusted month term, and terms for the year and century to produce a raw value called h, which is then taken modulo 7 to give a number representing a specific weekday (in this calculator 0 is Saturday, 1 is Sunday, 2 is Monday and so on up to 6 for Friday).

Because it needs no lookup tables or calendar libraries, Zeller's congruence has long been used to teach modular arithmetic, to verify that a historical date fell on the weekday a document claims, and to implement day-of-week logic in embedded or resource-constrained systems where importing a full calendar library isn't practical.

This calculator takes any date in the Gregorian calendar, walks through Zeller's formula, and shows both the resulting weekday and the intermediate raw h value.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators