Day of the Week Calculator

Find what day of the week any date falls on, past or future, using Zeller’s congruence — with the working shown.

How to use this calculator

  1. 1Pick any date, past or future.
  2. 2The weekday and the full Zeller’s congruence working are shown together.

How the calculation works

h = (q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J) mod 7
q
Day of the month
m
Month, with January and February counted as 13 and 14 of the previous year
K
Year within the century (year mod 100)
J
The century (year ÷ 100, floored)
h
0 = Saturday, 1 = Sunday, 2 = Monday, … 6 = Friday

Devised by Christian Zeller in the 1880s, this computes the weekday directly from the date with no lookup table and no iteration — a closed-form formula for a calendar system that looks like it should need one.

Treating January and February as months 13 and 14 of the previous year absorbs the leap-day irregularity cleanly into the same formula that handles every other month.

This implementation is cross-checked against the platform’s own calendar arithmetic, and the two never disagree for any valid Gregorian date.

Worked example

1 January 2000

  1. 1.January is shifted to month 13 of the previous year, so m = 13, y = 1999.
  2. 2.K = 1999 mod 100 = 99. J = ⌊1999/100⌋ = 19.
  3. 3.h = (1 + ⌊13×14/5⌋ + 99 + ⌊99/4⌋ + ⌊19/4⌋ + 5×19) mod 7 = (1 + 36 + 99 + 24 + 4 + 95) mod 7 = 259 mod 7 = 0.
  4. 4.h = 0 corresponds to Saturday.

Result: Saturday

Why the same date falls on a different weekday each year

A calendar year is not a whole number of weeks, and that mismatch is the entire reason a fixed date does not repeat its weekday from one year to the next. A common year runs 365 days — one more than an exact 52 weeks — so whatever weekday a date fell on shifts forward by exactly one day the following year. A leap year adds a second day of shift for any date after February 29, because the extra day inserted that month pushes everything past it one further step around the week. That single mismatch, 365 divided by 7 leaving a remainder of 1, is the whole mechanism behind why a birthday drifts steadily through the days of the week rather than sitting on the same one forever.

A calendar that resets itself every 400 years

The Gregorian calendar’s leap-year rule is more particular than "every fourth year": a year divisible by 100 is not a leap year unless it is also divisible by 400, which is why 1900 was not a leap year but 2000 was. That rule exists to keep the calendar tracking the solar year more precisely, but it has a convenient side effect — across exactly 400 years the calendar contains 146,097 days, and 146,097 divides evenly by 7 into 20,871 whole weeks. Because a whole number of weeks fits inside those four centuries with nothing left over, the entire weekday pattern for every date on the calendar repeats itself exactly, with no drift at all, once every 400 years.

The Doomsday shortcut for doing this in your head

Long before pocket calculators, mathematician John Horton Conway devised a mental shortcut now known as the Doomsday rule for working out a weekday without writing anything down. It leans on the fact that several easy-to-remember dates always share the same weekday within any single year — 4/4, 6/6, 8/8, 10/10 and 12/12 among them, along with the last day of February — a shared weekday Conway called that year’s "doomsday." Once you know a year’s doomsday, you find whichever of those anchor dates sits closest to the date you actually care about and count forward or back in whole weeks to land on the answer. The doomsday itself shifts in a predictable pattern from year to year and century to century — every year in the 2000s, for instance, has its doomsday on a Tuesday — so with a bit of practice the whole calculation can be done in your head.

When Britain’s calendar itself jumped forward

Zeller’s congruence and the Doomsday rule both assume the Gregorian calendar was already in effect, but it was not adopted everywhere at once. Pope Gregory XIII introduced it in 1582 to correct centuries of accumulated drift in the older Julian calendar, and Catholic countries switched over almost immediately, while Britain and its colonies held out until 1751, when Parliament passed an act mandating the change. Making the switch meant skipping eleven accumulated days outright: Wednesday, September 2, 1752 was directly followed by Thursday, September 14, 1752, with the dates in between simply never occurring in the British calendar. A weekday calculation for a date before a given country’s own switch will not line up with that country’s historical records, since they were still being kept on the Julian system at the time.

Where knowing the weekday actually matters

Working out the weekday for a date outside living memory, or far enough ahead that nobody has it memorized yet, comes up in a wider range of ordinary and specialized situations than it might seem.

  • Contracts and legal deadlinesmany agreements define a deadline as a number of days after a signing date, and whether that lands on a weekend changes which day the work is actually due.
  • Birthdays and anniversariesfiguring out which day of the week a birthday or anniversary will fall on in a coming year, useful for planning a party or a trip around it.
  • Genealogy and historical researchchecking a birth, marriage or death record against the weekday it claims, which is one of the simplest ways to catch a transcription error in an old document.
  • Mental calculation and memory sportnaming the weekday of any date on demand is a classic feat of mental math, and the Doomsday rule is the technique most competitive mental calculators actually use to do it.

What this assumes, and where it stops

Assumptions

  • The Gregorian calendar applies throughout.

Limitations

  • Dates before the Gregorian calendar’s adoption in a given region will not match historical records, which often used the Julian calendar.

Common questions

How does Zeller’s congruence work without a calendar?

It encodes the calendar’s structure directly into arithmetic — the 13(m+1)/5 term approximates how many days each month adds relative to a 7-day week, and the century terms handle the Gregorian leap-year rule (divisible by 4, except centuries unless divisible by 400). The result is a formula that reproduces the calendar without ever storing one.

Can I use this to find what day I was born?

Yes — enter your date of birth and the exact weekday is computed directly, with no lookup limit on how far back it can go within the Gregorian calendar.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the day of the week calculator.

See all date & time calculators →