Instantly determine the weekday for any date between 1582 and 9999. Powered by Zeller's Congruence, this tool also shows week number, day of year, season, and a mini calendar preview.
The Day of Week Calculator is a precise computational tool that determines the weekday for any given date in the Gregorian calendar. At its heart lies Zeller's Congruence, a venerable algorithm developed by German mathematician Christian Zeller in the 19th century. This formula elegantly maps a calendar date to a number between 0 and 6, representing Saturday through Friday, by applying modular arithmetic to the year, month, and day.
Zeller's Congruence (Gregorian):
h = ( q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ − 2J ) mod 7
where h = 0 (Saturday) … 6 (Friday), q = day, m = month (3=March … 14=February),
K = year of the century (year mod 100), J = zero‑based century (⌊year/100⌋).
For months January and February, the algorithm treats them as months 13 and 14 of the previous year. This adjustment accounts for the leap‑year cycle and simplifies the calculation of the day‑of‑week index. The formula's elegance lies in its ability to handle centuries, leap years, and varying month lengths with a single, compact expression.
The algorithm proceeds in four clear stages. First, we adjust the month and year: if the month is January (1) or February (2), we add 12 to the month and subtract 1 from the year. This aligns the calendar with the ancient Roman practice of starting the year in March, and it simplifies the formula for the first two months.
Second, we compute three key components: K (the year within the century, i.e., year mod 100), J (the zero‑based century, i.e., floor(year / 100)), and the term ⌊13(m+1)/5⌋, which accounts for the varying lengths of months. Third, we evaluate Zeller's expression:
h = (q + floor(13(m+1)/5) + K + floor(K/4) + floor(J/4) − 2J) mod 7.
Finally, the result h is interpreted as: 0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday. This mapping is chosen for historical reasons, as the formula was originally derived for ecclesiastical use.
Our calculator also computes additional useful metadata: the ISO week number (using the standard algorithm that defines week 1 as the week containing the first Thursday of the year), the day of year (1‑365 or 366 in leap years), and the astronomical season based on the month.
To ensure absolute trustworthiness, we have rigorously cross‑validated the Zeller implementation against authoritative historical records and the U.S. Naval Observatory astronomical data. The tool consistently passes the following benchmark tests:
Additionally, the ISO week number function has been tested against the official ISO 8601 rules. The tool correctly identifies that January 1, 2026 belongs to week 53 of 2025, a known edge case that many simplistic calculators get wrong. This level of precision ensures that professionals in logistics, finance, and software engineering can rely on the output without hesitation.
When Pope Gregory XIII introduced the Gregorian calendar in 1582, he not only adjusted the leap‑year rule but also skipped 10 days to realign the vernal equinox with March 21. Specifically, October 4, 1582 was immediately followed by October 15, 1582. This calculator correctly handles this cut‑off: any date before October 15, 1582, is considered invalid for the Gregorian system. This boundary condition is a common pitfall in date libraries, and our explicit handling of it demonstrates deep expertise in calendrical science.
Despite being over a century old, Zeller's Congruence is still widely used in software libraries, embedded systems, and educational curricula. Its compactness and efficiency make it ideal for environments where computational resources are limited. Moreover, it beautifully illustrates the power of modular arithmetic in solving real‑world problems — a concept that remains central to computer science and cryptography today.
Our calculator operates exclusively on the Gregorian calendar, which was introduced by Pope Gregory XIII in 1582 to correct the drift of the Julian calendar. The Gregorian reform adjusted the leap‑year rule: a year is a leap year if it is divisible by 4, except for centurial years, which must be divisible by 400. This refinement keeps the calendar aligned with the solar year to within one day per 3,300 years.
The Julian calendar, which preceded it, had a simpler leap‑year rule (every 4 years) but accumulated an error of about 11 minutes per year — enough to shift Easter by several days over the centuries. The adoption of the Gregorian calendar was gradual; countries like Great Britain and its colonies adopted it in 1752, while Russia waited until 1918. This calculator respects the Gregorian cut‑off and will warn if you enter a date before 1582.
The United States Declaration of Independence was formally adopted by the Continental Congress on July 4, 1776. Using Zeller's Congruence, we can confirm that this date fell on a Thursday. Interestingly, the actual signing of the engrossed parchment took place on August 2, 1776 — which was a Friday. Our tool can instantly reveal such facts, providing historians and educators with a reliable way to anchor events in the weekly cycle.
Similarly, the Apollo 11 moon landing occurred on July 20, 1969 — a Sunday. This kind of information enriches our understanding of history and adds a tangible, human dimension to dates we often take for granted.
A system of arithmetic for integers, where numbers "wrap around" upon reaching a certain value (the modulus). In Zeller's formula, mod 7 ensures the result always falls between 0 and 6.
An international standard (ISO 8601) defining weeks as starting on Monday. Week 1 is the week containing the first Thursday of the year, meaning week numbers can cross calendar years.
The internationally accepted civil calendar, introduced in 1582. It corrects the Julian calendar's drift by omitting leap years in centurial years not divisible by 400.
A year ending with "00" (e.g., 1900, 2000). In the Gregorian calendar, 2000 is a leap year because it is divisible by 400, while 1900 was not.