The day-of-week calculator tells you exactly which weekday any date falls on — together with its ISO weekday number, day-of-year, ISO week designator, and Julian Day Number. Unlike a basic date-picker, it also shows the step-by-step arithmetic behind the answer, lets you scan a whole date range at once, and renders a visual week strip and mini monthly calendar so the result is immediately legible. Everything runs locally in your browser: no dates are transmitted anywhere.
How it works
The calculator implements Tomohiko Sakamoto’s algorithm, a compact formula for computing the day of the week on the proleptic Gregorian calendar. Here is the logic in plain language:
-
Adjust for January and February. Months 1 and 2 are treated as months 13 and 14 of the previous year. This sidesteps the awkwardness of February’s variable length early in the calculation.
-
Look up the month offset. A pre-computed table
[0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4](indexed January through December) encodes the cumulative day-of-week shift each month introduces. For March the offset is 2, for July it is 5, and so on. -
Apply century corrections. The Gregorian calendar skips a leap year on century years not divisible by 400. Three terms handle this: add
floor(y/4)(Julian leap correction), subtractfloor(y/100)(century suppression), addfloor(y/400)(400-year reinstatement). -
Sum and reduce. Add the adjusted year, the three century terms, the month offset, and the day number, then take the result modulo 7. The remainder maps to 0=Sunday through 6=Saturday.
The formula in compact form is:
dow = (y + floor(y/4) - floor(y/100) + floor(y/400) + t[m] + d) mod 7
where y is the adjusted year, t[m] is the month offset, and d is the day of the month.
For ISO week numbers the tool identifies the Thursday of each week (ISO weeks are defined by where Thursday falls), then counts how many weeks that Thursday is from the first Thursday of the year. The Julian Day Number is computed via the standard astronomical conversion formula and can be subtracted between any two dates to get an exact day count.
Worked example
Take 14 October 1066 — the Battle of Hastings.
- October is month 10, which is after February, so the year stays as
y = 1066. - Month offset
t[10] = 6(October is index 9 in the zero-based lookup table[0,3,2,5,0,3,5,1,4,6,2,4]). - Century terms:
floor(1066/4) = 266,floor(1066/100) = 10,floor(1066/400) = 2. - Sum:
1066 + 266 - 10 + 2 + 6 + 14 = 1344. 1344 mod 7 = 0→ Sunday (on the proleptic Gregorian calendar).
| Date | Calculation summary | Result |
|---|---|---|
| 14 Oct 1066 | (1066 + 266 - 10 + 2 + 6 + 14) mod 7 | Sunday |
| 4 Jul 1776 | (1776 + 444 - 17 + 4 + 5 + 4) mod 7 | Thursday |
| 1 Jan 2000 | (1999 + 499 - 19 + 4 + 0 + 1) mod 7 | Saturday |
| 15 Jun 2026 | (2026 + 506 - 20 + 5 + 3 + 15) mod 7 | Monday |
The “Show step-by-step working” toggle in the calculator displays every one of those arithmetic steps labelled clearly, so you can follow or verify the computation for any date you enter.
Formula note
Tomohiko Sakamoto’s formula is equivalent to, but more compact than, the classical Zeller’s congruence. Both work on the proleptic Gregorian calendar, meaning they extrapolate the current calendar rules backward through history even for dates before the Gregorian reform of 1582. If you need the Julian calendar (used in Europe before the switch), the century correction terms change, but most historical and all modern usage assumes the proleptic Gregorian calendar, which is what this tool uses.
The Julian Day Number formula used here is the standard one from the Explanatory Supplement to the Astronomical Almanac: it maps any Gregorian calendar date to a unique integer counting days from the astronomical epoch (noon, 1 January 4713 BCE). Subtracting two JDNs always gives the exact integer count of days between them, with no calendar boundary complications.