Finding the day of the week
Every date in the Gregorian calendar falls on one of seven weekdays, and the pattern repeats exactly every 400 years. Because 400 Gregorian years contain 146,097 days, which is a whole number of weeks (20,871), the weekday for any date can be found with simple arithmetic. This calculator converts the date to a day serial number and takes the remainder after dividing by 7, which gives the weekday directly.
Doing it by hand: Zeller-style formula
Several mental methods exist. One of the best known is Zeller's congruence. Treat January and February as months 13 and 14 of the previous year, then compute:
q = day of month, m = month (3 = March … 14 = February), K = year mod 100, J = ⌊year ÷ 100⌋
h = 0 Saturday, 1 Sunday, 2 Monday, … 6 Friday
Worked example: July 4, 1976
Here q = 4, m = 7, K = 76 and J = 19. Then ⌊13 × 8 ÷ 5⌋ = 20, ⌊76 ÷ 4⌋ = 19, ⌊19 ÷ 4⌋ = 4 and 5 × 19 = 95. The sum is 4 + 20 + 76 + 19 + 4 + 95 = 218, and 218 mod 7 = 1, which is Sunday. The US Bicentennial was indeed celebrated on a Sunday. It was day 186 of 366 in the leap year 1976, leaving 180 days, and it was the 27th of 52 Sundays that year.
The Doomsday rule
Mathematician John Conway popularized a faster mental method called the Doomsday rule. In any year, a set of easy-to-remember dates all share the same weekday, called the doomsday: 4/4, 6/6, 8/8, 10/10 and 12/12, plus 5/9, 9/5, 7/11 and 11/7, the last day of February, and March 14 (Pi Day). For 2026 the doomsday is a Saturday, so July 4, 2026 is also a Saturday. Once you know the year's doomsday, count forward or back from the nearest anchor date.
Day of the year and weekday counts
| Output | Meaning |
|---|---|
| Day of the year | January 1 is day 1. December 31 is day 365, or 366 in a leap year. |
| Days left | Days remaining after the chosen date until the end of December. |
| Weekday occurrence | Which Sunday (or Monday, and so on) of the year the date is. |
| Weekday total | Each weekday occurs 52 times in a year, and one or two weekdays occur 53 times. |
| ISO week number | ISO 8601 weeks start on Monday; week 1 is the week containing the first Thursday of January. |
A common year has 365 days, which is 52 weeks plus 1 day, so the weekday that January 1 falls on appears 53 times. A leap year has 52 weeks plus 2 days, so two weekdays appear 53 times. In 2028, for example, December 31 is the 53rd Sunday of the year.
Why the weekday shifts each year
Because 365 is one more than a multiple of 7, a given date moves forward one weekday each ordinary year and two weekdays after a leap day. If your birthday is on a Tuesday this year, it will usually be on a Wednesday next year, or a Thursday if February 29 comes in between. Calendars therefore repeat in cycles: a common year's layout recurs after 6, 11 or 28 years depending on where it sits in the leap cycle.
Historical dates
The calculator uses the proleptic Gregorian calendar for every date. Countries adopted the Gregorian calendar at different times: much of Catholic Europe in 1582, Great Britain and its colonies in 1752, Russia in 1918. Weekdays never broke sequence during the switch, but the date numbers did, so for events recorded in the older Julian calendar you need to convert the date first.