Day of the Week Calculator
Find out what day of the week any date falls on — past, present, or future.
Day of the Week Calculator: Zeller’s Congruence Formula Guide
Written by Mathew | Financial Tools & Calculation Specialist · Last updated July 31, 2026
In two sentences: A day of the week calculator determines which weekday any calendar date falls on using Zeller’s Congruence, an algorithm developed by Christian Zeller in the 19th century that combines the day, an adjusted month number, and year components into a single modulo-7 calculation. This guide breaks down the exact formula, its quirky month-numbering convention, and a full worked example you can follow step by step.
What Is a Day of the Week Calculator?
A day of the week calculator determines which day of the week — Sunday through Saturday — any given calendar date falls on, using a mathematical formula rather than looking up a calendar. This is especially useful for historical dates, future planning, or verifying a date without needing a physical or digital calendar reference on hand.
The Day of the Week Formula: Zeller’s Congruence
h = ( q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J ) mod 7
h = day of the week (0 = Saturday, 1 = Sunday, 2 = Monday, ... 6 = Friday)
q = day of the month
m = month (3 = March, 4 = April, ... 14 = February)
K = year of the century (year mod 100)
J = zero-based century (year ÷ 100, rounded down)
⌊ ⌋ = floor function (round down to the nearest integer)
The unusual month-numbering rule
Zeller’s Congruence numbers months starting from March as month 3, all the way through February of the following year as month 14 — meaning January and February are treated as months 13 and 14 of the previous year. This adjustment exists specifically to simplify how the formula handles leap years, since February’s variable length (28 or 29 days) is the source of most calendar irregularity, and pushing it to the end of the counted year keeps the core formula cleaner.
Worked Example: Finding the Day of the Week for July 4, 1976
Date: July 4, 1976
q = 4 (day of month)
m = 7 (July stays as month 7, since it's already March or later)
Year = 1976, so K = 76 (year mod 100) and J = 19 (1976 ÷ 100, floored)
h = (4 + ⌊13×(7+1)/5⌋ + 76 + ⌊76/4⌋ + ⌊19/4⌋ + 5×19) mod 7
= (4 + ⌊104/5⌋ + 76 + ⌊19⌋ + ⌊4.75⌋ + 95) mod 7
= (4 + 20 + 76 + 19 + 4 + 95) mod 7
= 218 mod 7
= 1
With h = 1 corresponding to Sunday, July 4, 1976 (America’s Bicentennial) fell on a Sunday — which checks out against historical record.
A Second Worked Example: A Date in January
Finding the day of the week for January 15, 2026 requires applying the January/February adjustment first.
Date: January 15, 2026
Since the month is January, treat it as month 13 of the previous year (2025):
q = 15
m = 13
Year becomes 2025, so K = 25 and J = 20
h = (15 + ⌊13×(13+1)/5⌋ + 25 + ⌊25/4⌋ + ⌊20/4⌋ + 5×20) mod 7
= (15 + ⌊182/5⌋ + 25 + ⌊6.25⌋ + 5 + 100) mod 7
= (15 + 36 + 25 + 6 + 5 + 100) mod 7
= 187 mod 7
= 5
With h = 5 corresponding to Thursday, January 15, 2026 falls on a Thursday.
Step-by-Step: How to Use a Day of the Week Calculator
- Identify the day, month, and year of your target date.
- If the month is January or February, treat it as month 13 or 14 of the previous year — subtract 1 from the year, and adjust the month number accordingly.
- Calculate K (year mod 100) and J (year divided by 100, rounded down) using this adjusted year.
- Apply the full Zeller’s Congruence formula, being careful to floor (round down) each division term before adding.
- Take the final result mod 7, and match it to the corresponding day using the 0=Saturday through 6=Friday convention.
Why the Formula Requires the January/February Adjustment
Zeller’s Congruence was designed around the observation that the day of the week progresses predictably based on each part of a date, but February’s variable length (28 or 29 days depending on leap years) disrupts that predictable progression if it’s treated as a “normal” month within the standard calculation. By redefining the calendar year to start in March and end in February of the following year, the leap-day irregularity gets pushed to the very end of the counted year, where it’s easier for the formula’s leap-year term (⌊K/4⌋) to account for consistently, rather than needing a special-case adjustment mid-formula.
Alternative Approaches to Finding the Day of the Week
Zeller’s Congruence isn’t the only method for this calculation. A simpler, though computationally slower, approach starts from a known anchor date — for instance, January 1, 1600 was a Saturday — and steps forward or backward one day (and one weekday) at a time until reaching the target date. This “naive” method is easy to understand and verify by hand for nearby dates but becomes impractical for dates far from the anchor point, which is exactly why a closed-form formula like Zeller’s Congruence remains the standard choice for calculating any arbitrary date efficiently.
Verifying a Day of the Week Calculator Result by Hand
A day of the week calculator’s output is worth double-checking with a simple sanity method, especially when working through the formula manually for the first time.
Practical ways to verify a day of the week calculator
- Check against a known anchor date first. Confirming a day of the week calculator correctly identifies a well-known date — like January 1, 2000, a Saturday — before trusting it on an unfamiliar historical date builds confidence in the specific implementation you’re using.
- Watch for the January/February adjustment specifically. The single most common manual error when running a day of the week calculator by hand is forgetting to shift January and February dates into the previous year’s month 13/14 framework before plugging in K and J.
- Use the floor function correctly on each division term. Since Zeller’s Congruence relies on rounding down at several steps, a day of the week calculator applied by hand needs each division term truncated, not rounded to the nearest whole number, or the final result will be off.
- Cross-check a far-future or far-past date against a digital calendar when possible. For any date within reach of a standard calendar application, comparing a day of the week calculator’s formula-based result against that reference is the fastest way to catch an implementation mistake.
Frequently Asked Questions
This convention pushes February — the only month with a variable length due to leap years — to the very end of the counted year, which simplifies how the formula’s leap-year adjustment term works, avoiding the need for a special mid-year exception.
The version shown here is specifically for the Gregorian calendar, which was adopted in 1582 and later in different countries at different times. A separate but related version of Zeller’s Congruence exists for the Julian calendar, used for dates before a given region’s Gregorian adoption.
Yes — the formula works identically for any valid Gregorian calendar date, whether in the past or future, since it’s based purely on consistent mathematical relationships between the day, month, and year components, not on any external calendar reference.
Simpler in structure, but far less efficient computationally, is the “count forward from a known date” method — for dates very close to a known reference point, direct counting is easy to verify by hand, but Zeller’s Congruence remains far faster for dates that are many years removed from any convenient anchor.
Related Calculators
- Currency Converter
- Time Zone
- Time Duration Calculator
- Day Counter
- Unit Converter
- Age Calculator
- Discount Calc
- Tip Calculator
- Alcohol Unit Calculator
- Molecular Weight Calculator
- Btu Calculator
- Golf Handicap Calculator
- Dew Point Calculator
- Roofing Calculator
In summary, a day of the week calculator built on Zeller’s Congruence turns any calendar date into its corresponding weekday through a compact modular arithmetic formula, and understanding the unusual March-to-February month numbering convention explains exactly why the formula handles leap years so cleanly.
About the author: Mathew is a Financial Tools & Calculation Specialist focused on building and fact-checking online calculators across mathematics and calendar-related tools.
Note: This calculator and article are provided for general educational and informational purposes only. Always double-check results for critical historical, legal, or scheduling applications.