Day of the Week

John Conway's Doomsday rule turns the calendar into modular arithmetic you can do in your head. Here are the formulas, why each one works, a calculator that shows its working, and a practice game.

The idea

The rule in one line

This page uses arithmetic “mod 7”: counting on a 7-day loop and keeping only the remainder. If that's new, Modular Arithmetic Basics explains it from the start, beginning with clocks.

The calendar is modular arithmetic too, and the mathematician John Conway turned that into a party trick you can do in your head: the Doomsday rule. Each year, a set of easy-to-remember dates all fall on the same day of the week, called that year's doomsday. Find it, then count from the nearest one.

The whole rule in one line
weekday = ( A(c) + S(y) + d − D(m) ) mod 7
  • A(c) the century's anchor day, from the first two digits of the year, c (Step 1)
  • S(y) the year's shift: how far the doomsday has moved since the century began, from the last two digits, y (Step 2)
  • d − D(m) how far your day d is from D(m), that month's doomsday date (Steps 3 and 4)

Every piece is just a count of days, and “mod 7” turns a count of days into a day of the week, exactly like a 7-position clock (see Modular Arithmetic Basics).

Number the days

Sunday = 0, Monday = 1, … Saturday = 6. Conway's memory aids: Noneday, Oneday, Twosday, Treblesday, Foursday, Fiveday, Six-a-day.

Step 1

The century's anchor, A(c)

A(c) = (5 × (c mod 4) + 2) mod 7 (c = the first two digits of the year)
c mod 45 × (c mod 4) + 2mod 7AnchorCenturies
022Tuesday1600s, 2000s, 2400s
170Sunday1700s, 2100s
2125Friday1800s, 2200s
3173Wednesday1900s, 2300s

Why it works. A century normally has 76 ordinary years and 24 leap years: 76 × 365 + 24 × 366 = 36,524 days, which is 5,217 weeks and 5 days. So each new century's doomsday lands 5 days later in the week, and on a 7-day clock, 5 forward is the same as 2 back. That's why the anchors step Tuesday → Sunday → Friday → Wednesday. The step into a year divisible by 400 (like 2000) also picks up that year's extra leap day, so it moves 6 instead of 5, and 5 + 5 + 5 + 6 = 21 days is exactly 3 weeks. The pattern therefore repeats every 400 years. In the formula, the “+ 2” is the starting point (2000 is a Tuesday, day 2), and the “5 ×” is that 5-day step per century.

To remember the two you'll use most: 1900 is a Wednesday (“We were born in the 1900s”), and 2000 is a Twosday (“Y2K”).

Step 2

The year's shift, S(y)

S(y) = y + ⌊y/4⌋
the definition
≡ ⌊y/12⌋ + (y mod 12) + ⌊(y mod 12)/4⌋
Conway's twelves
≡ (7 − (T₂ mod 7)) mod 7
“odd + 11” (T₂ is explained below)

y is the last two digits of the year, and ⌊ ⌋ means “round down”: ⌊26/4⌋ = 6. The three lines give different numbers (32, 4 and 4 for 2026), but the same remainder after dividing by 7, which is all that matters on a 7-day clock. That's what ≡ (mod 7) means. Use whichever you find easiest.

doomsday of the year = (A(c) + S(y)) mod 7

Why it works. An ordinary year is 365 days, which is 52 weeks and 1 day, so each year's doomsday falls 1 day later in the week than the last. A leap year has 366 days, so the doomsday jumps 2. From the start of the century to year y, that's y one-day steps, plus one extra for each leap year along the way, and there are ⌊y/4⌋ of those. (A leap year's own extra day counts here, because its February 29 comes before that year's doomsday dates from March onward; Step 3 deals with January and February.)

For 2026: S(26) = 26 + ⌊26/4⌋ = 26 + 6 = 32, and 32 mod 7 = 4. Tuesday (2) + 4 = day 6, Saturday, the doomsday for 2026.

Where the shortcuts come from. Both are y + ⌊y/4⌋ rearranged to keep the numbers small:

  • Conway's twelves. Write y = 12a + r (a twelves, remainder r). Then y + ⌊y/4⌋ = 12a + r + 3a + ⌊r/4⌋ = 15a + r + ⌊r/4⌋. Since 15 = 14 + 1 and 14 is two whole weeks, 15a counts the same as a:
    S(y) ≡ a + r + ⌊r/4⌋ 2026: a = 2, r = 2, ⌊2/4⌋ = 0 → 2 + 2 + 0 = 4
  • “Odd + 11”. The same total, rearranged so you only ever halve and add 11:
    T₁ = y, plus 11 if y is odd T₂ = T₁ / 2, plus 11 if that's odd S(y) ≡ (7 − (T₂ mod 7)) mod 7 2026: T₁ = 26 (even, so no +11) T₂ = 26 / 2 = 13, odd, so 13 + 11 = 24 S ≡ 7 − (24 mod 7) = 7 − 3 = 4
Step 3

The doomsday dates, D(m)

MonthJanFebMarAprMayJunJulAugSepOctNovDec
D(m)3 / 4*28 / 29*14496118510712

* The second number is for leap years. Only January and February change; see the box below.

Why they all share a weekday. The gap between each doomsday date and the next is a whole number of weeks, so they all land on the same day of the week:

2/2814 days
2 wk
3/1421 days
3 wk
4/435 days
5 wk
5/928 days
4 wk
6/635 days
5 wk
7/1128 days
4 wk
8/828 days
4 wk
9/535 days
5 wk
10/1028 days
4 wk
11/735 days
5 wk
12/12
January and February in a leap year

The year's doomsday, A(c) + S(y), already includes that year's February 29. That's right for March to December, which come after the leap day. January and February come before it, so in a leap year their doomsday dates move one day later:

January doomsdaysFebruary doomsdays
Common year3, 10, 17, 24, 317, 14, 21, 28
Leap year4, 11, 18, 251, 8, 15, 22, 29

Why. The last day of February is always a doomsday, because March 14 is exactly 2 weeks later (it's “March 0”). In a leap year the last day is the 29th, not the 28th, so every January and February doomsday date shifts with it. Count back 8 weeks (56 days) from the last day of February and you land on January 3 in a common year, or January 4 in a leap year.

Example: January 1, 2024. 2024 is a leap year. A = 2, S(24) = 24 + 6 = 30, so the doomsday is (2 + 30) mod 7 = 4, Thursday. With the leap-year date D(1) = 4: (4 + 1 − 4) mod 7 = 1, Monday, which is correct. Using 3 by mistake gives Tuesday, one day off. That's the most common slip with this rule.

Is it a leap year? If the year is divisible by 4, yes, except century years, which are leap years only when divisible by 400. So 2024 and 2000 were leap years; 1900 and 2100 aren't.

How to remember them:

4/4, 6/6, 8/8, 10/10, 12/12Even months: the day matches the month.
9/5, 5/9, 7/11, 11/7“I work 9 to 5 at the 7-Eleven”: each pair works either way round.
March 14Pi Day. Also “March 0”, the last day of February.
January 3, or 4 in a leap year“The 3rd, three years in four; the 4th in the fourth.”
Last day of FebruaryThe 28th, or the 29th in a leap year.
Bonus anchorsJuly 4, Halloween (10/31) and Boxing Day (12/26) are doomsdays too.
Step 4

Count to your date, d − D(m)

weekday = (doomsday of the year + d − D(m)) mod 7

Christmas 2026: the year's doomsday is Saturday (6), and December's doomsday date is the 12th, so (6 + 25 − 12) mod 7 = 19 mod 7 = 5, a Friday. Going backwards works the same way: December 1 gives (6 + 1 − 12) mod 7 = −5 mod 7 = 2, a Tuesday. (−5 mod 7 is 2, just as going back 5 hours on a 7-position clock lands on 2.)

All in one line, for Christmas 2026: 2 + 32 + 25 − 12 = 47, and 47 mod 7 = 5, Friday.

The rule uses the Gregorian calendar, which Spain, Portugal, Italy, Poland and France adopted in 1582, other countries over the following centuries, and Britain and its colonies in 1752. Earlier dates in those places were recorded in the Julian calendar, so a historical date may not match.

Try it

Work out any date

    The same answer from one formula (Zeller's congruence)

    Christian Zeller's 1882 formula does the whole thing in one line. Treat January and February as months 13 and 14 of the previous year. With q the day, m the month, K the year's last two digits and J its first two:

    h = (q + ⌊13(m + 1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J) mod 7 (0 = Saturday, 1 = Sunday, …)
    Practice

    Practice

    A random date appears. Work out its day in your head, then tap your answer.