Day of the Week Calculator

Find the day of the week for any date.

Day of the week Wednesday

Formula: Sakamoto's algorithm

Step-by-step with your numbers:
1. Values used:
2. Year = 2,026
3. Month = 6
4. Day = 24
5.
6. Day of the week = Wednesday
Did we solve your problem today?

Find which day of the week any calendar date falls on.

How the Math Works

Sakamoto's algorithm is a clever method for calculating the day of the week for any date in the Gregorian calendar. The formula works by using a lookup table of month codes that account for the irregular distribution of days across months, combined with a leap year adjustment. Specifically, it uses the expression: day = (day + floor(2.6*m - 0.2) + y + floor(y/4) + floor(c/4) - 2*c) mod 7, where m is the adjusted month (March=0, April=1, ..., January=13, February=14), y is the last two digits of the year, and c is the first two digits of the year. The month codes table [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4] captures how each month's starting day shifts, and the algorithm cleverly handles leap years by treating January and February as belonging to the previous year.

Practical Applications

To apply Sakamoto's algorithm in practice, start by adjusting the month and year: if the month is January or February, decrement the year by 1 and add 12 to the month. Extract the century (c) and year within century (y) from your adjusted year. Look up the month code from the predefined table, then plug these values into the formula. For example, to find July 4, 1776: month=5 (July), y=76, c=17, month_code=0. Calculate: (4 + floor(2.6*5 - 0.2) + 76 + floor(76/4) + floor(17/4) - 2*17) mod 7 = (4 + 12 + 76 + 19 + 4 - 34) mod 7 = 81 mod 7 = 4, which corresponds to Thursday. The result maps to days where 0=Sunday, 1=Monday, through 6=Saturday.

Day-to-Day Use

This calculation proves invaluable for planning and historical research in everyday life. When organizing events, you can quickly verify dates fall on weekends or specific weekdays without consulting calendars. Students researching historical documents can cross-reference dates to understand chronological context. Travelers planning trips can anticipate weather patterns or seasonal activities tied to specific weekdays. Legal professionals checking limitation periods or contract deadlines find it useful for quick verification. Even for casual purposes like remembering birthdays or anniversaries, knowing the day helps gauge social media engagement patterns or simply satisfies curiosity about when significant personal moments occurred.

Worked example

24 June 2026 is a Wednesday.

FAQ

Does it handle leap years?

Yes - the formula accounts for the Gregorian leap-year rules.