Understanding the day of the week calculator — concept and principle
This calculator finds the weekday of any date with Zeller's congruence, a short formula published by the German mathematician Christian Zeller in the 19th century. Use it to check what day a birthday, holiday or deadline falls on, or to see how a weekday can be computed by hand.
How it is calculated
For a date with day q, month m and year Y in the Gregorian calendar:
h = (q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J) mod 7
- q is the day of the month (1–31).
- m is the month number, but March = 3 up to December = 12, and January and February are treated as months 13 and 14 of the previous year.
- K is the year of the century (Y mod 100) and J is the century (⌊Y/100⌋), both taken after the January/February adjustment.
⌊x⌋ means round down; mod 7 is the remainder after dividing by 7. h = 0 is Saturday, 1 Sunday, 2 Monday … 6 Friday.
The principle
Only the day count modulo 7 matters, and each term counts weekday shifts. A 365-day year is 52 weeks plus 1 day, so each year shifts the weekday by one (K). Leap days add more shifts: ⌊K/4⌋ within the century, ⌊J/4⌋ and 5J for the Gregorian century rule (century years are leap years only if divisible by 400). ⌊13(m+1)/5⌋ reproduces the uneven 30/31-day months. Treating January and February as the end of the previous year puts 29 February last, so it never disturbs the month term.
Worked example
Default input: 25 December 2026.
- December needs no adjustment, so q = 25, m = 12, Y = 2026.
- K = 2026 mod 100 = 26 and J = ⌊2026/100⌋ = 20.
- Month term: ⌊13 × 13 / 5⌋ = ⌊33.8⌋ = 33.
- Leap terms: ⌊26/4⌋ = 6 and ⌊20/4⌋ = 5; century term 5 × 20 = 100.
- Sum: 25 + 33 + 26 + 6 + 5 + 100 = 195.
- 195 mod 7 = 6 (because 7 × 27 = 189), and h = 6 means Friday. Christmas 2026 is a Friday, matching the calculator.
How to read the result
The table shows q, the adjusted m, K, J and h so you can follow the arithmetic. For January or February dates, m shows 13 or 14 and K, J come from the previous year; that is expected.
Common mistakes
- Forgetting to move January and February to the previous year, which shifts the answer by one or two days.
- Reading h = 0 as Sunday or Monday. In this form of the formula, 0 is Saturday.
- Using the formula for dates in the Julian calendar. Many countries switched to the Gregorian calendar at different times (from 1582 in parts of Europe, 1752 in Britain, 1896 in Korea).
Frequently asked questions
What day of the week is Christmas 2026?
Friday, 25 December 2026.
Does the same date fall on the same weekday every year?
No. It moves forward by one weekday each year, and by two after 29 February of a leap year. The whole Gregorian pattern repeats every 400 years.
Does it work for lunar calendar dates?
No. Convert a lunar date to the solar (Gregorian) date first, then enter it.
Sources: Chr. Zeller, "Kalender-Formeln", Acta Mathematica, vol. 9 · E. M. Reingold and N. Dershowitz, Calendrical Calculations, Cambridge University Press