Pick the date you want to check (you can also type it in). Along with the day of the week, you get the day of the year and which occurrence of that weekday it is in the year.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formula
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter a date and see which day of the week it is, on the spot (for any year from 1 to 9999)
- You also get the day of the year (which day of the year it is) and the number of days left until New Year's Eve
- You also see which occurrence of that weekday it is in the year (for example, the 27th of the 52 Saturdays in the year)
- Use it for dates you have no calendar for: the day you were born, a day in history, or a future anniversary
- A plain-language explanation of how to calculate the day of the week (Zeller's congruence) and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
Many people do not know which day of the week they, or their family members, were born on. Birth certificates show the date, but not the weekday.
The old English nursery rhyme "Monday's child is fair of face, Tuesday's child is full of grace…" gives each birth weekday its own line, and in Thailand and Myanmar the weekday of your birth is important too (in Thailand, each weekday has its own color). Looking up your birth weekday is the most popular use of this page.
July 4, 1776 (the Declaration of Independence) was a Thursday, July 20, 1969 (the first Moon landing) was a Sunday, and September 11, 2001 was a Tuesday. Knowing the weekday helps you picture what that day was like for people then - a workday or a day off.
However, dates in records from before 1752 in Britain and its American colonies (before October 15, 1582 in much of Europe) are often Julian calendar dates, so they may differ from this calculator's result, which applies the Gregorian calendar backward.
Check ahead of time which weekday a wedding anniversary, a company anniversary or a family birthday falls on next year, or in 5 or 10 years, and you can plan things like "a big celebration in the year it falls on a Saturday".
Prices and availability at wedding venues and restaurants depend a lot on the day of the week, so there are more reasons than you might think to know the weekday of a date far in the future.
Bank counters and government offices are open only on weekdays, so sometimes you want to check whether the date on an old document was a weekday or a weekend - for example, "Was this receipt really dated on a business day?"
It also helps when you sort through diaries or budget records, or when you look up the weekday of a special day (the day you first met, the day you moved). This calculator does not know holidays, so for business days that include holidays, check a calendar as well.
Some people like to know when Friday the 13th comes. Check the 13th of each month, and those that fall on a Friday are your answer. In 2026 there are three: February 13, March 13 and November 13. In 2027 there is only one, August 13.
Every year has at least one Friday the 13th and never more than three, because the 13ths of the 12 months fall on all 7 weekdays over the course of a year.
Formula
Symbols and terms
Symbols
| \(h\) | h | The weekday number that Zeller's congruence gives: 0 = Saturday, 1 = Sunday, 2 = Monday, …, 6 = Friday. |
| \(q\) | q | The day of the month (the 4 in "July 4"). Zeller's congruence traditionally uses this letter for the day. |
| \(m\) | m | The month, from the first letter of "month". January and February are treated as months 13 and 14 of the year before, so \(m = 13\) and \(m = 14\). |
| \(K\) | K (capital) | The last 2 digits of the year. For 2026, \(K = 26\) (remember that January and February count as the year before). |
| \(J\) | J (capital) | The first 2 digits of the year (the century part). For 2026, \(J = 20\). |
| \(\lfloor x \rfloor\) | floor of x | The floor function: the largest whole number that is not more than \(x\). For numbers 0 or greater, it is the same as dropping the decimal part, so \(\lfloor 20.8 \rfloor = 20\) (all the numbers rounded down in this formula are 0 or greater). |
| \(\bmod\) | mod | The symbol for the remainder of a division, used as in \(21 \bmod 7 = 0\) (21 divided by 7 leaves a remainder of 0). |
| \(d\) | d | The day of the year: which day it is, counting from January 1 of that year. For July 4, 2026, \(d = 185\). |
| \(n\) | n | Which occurrence of that weekday the date is in the year. July 4, 2026 is the 27th Saturday of the year. |
Terms
| Zeller's congruence | A formula that calculates the day of the week directly from a date, created by the 19th-century German mathematician Christian Zeller. Without looking at a single calendar, it finds the weekday with only multiplication and "the remainder after dividing by 7". |
| Gregorian calendar | The calendar used around the world today. Pope Gregory XIII introduced it on October 15, 1582. Britain and its American colonies adopted it in 1752, when Wednesday, September 2 was followed by Thursday, September 14. |
| proleptic Gregorian calendar | The Gregorian calendar rules applied backward to dates before it was introduced (October 15, 1582). The international standard ISO 8601 and most computer date systems, including this calculator, use it. Its dates and weekdays can differ from the calendar that was actually used in history, such as the Julian calendar. |
| Julian calendar | The calendar used before the Gregorian calendar, set up by Julius Caesar in 45 BC. It made every fourth year a leap year without exception, so it slowly drifted away from the seasons and was replaced by the Gregorian calendar to fix this. American dates before 1752 are often Julian "Old Style" dates - George Washington was born on February 11, 1731 (Old Style), which is February 22, 1732 in the Gregorian calendar. |
| leap year | A year with a February 29 (366 days). It usually comes every 4 years, but years divisible by 100 are common years unless they are divisible by 400 (2000 was a leap year, 1900 and 2100 are not). |
| day of the year | Which day of the year a date is, counting from January 1 (sometimes loosely called the "Julian day" or "ordinal date"). For example, March 1 is day 60 in a common year and day 61 in a leap year. |
| weekly cycle | The days of the week repeat every 7 days. Two dates that are a multiple of 7 days apart always fall on the same weekday. |
| Doomsday rule | A method for finding the weekday of a date in your head, created by the mathematician John Conway. In any given year, some easy-to-remember dates all fall on the same weekday (the "doomsday"), such as 4/4, 6/6, 8/8, 10/10, 12/12 and the last day of February. For 2026 the doomsday is Saturday, which is why July 4, 2026 is a Saturday too. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Division with remainders (Grade 4) |
|
| How the calendar works (Grades 3–4) |
|
| 2-digit multiplication and rounding down (Grades 4–5) |
|
| Positive and negative numbers (Grades 6–7) |
|
How to calculate it in Excel
| Date to check | 2026-07-04 |
| Day of the week | =TEXT(B1,"dddd") |
| Date to check | 2026-07-04 |
| Weekday number (1 = Sunday to 7 = Saturday) | =WEEKDAY(B1) |
| Date to check | 2026-07-04 |
| Day of the year | =B1-DATE(YEAR(B1),1,1)+1 |
| Days in the year | =DATE(YEAR(B1),12,31)-DATE(YEAR(B1),1,1)+1 |
| Days left | =B3-B2 |
| Date to check | 2026-07-04 |
| Day of the year | =B1-DATE(YEAR(B1),1,1)+1 |
| Occurrence n | =INT((B2-1)/7)+1 |
The answers in the third and fourth tables are: day of the year 185, days in the year 365, days left 180, and occurrence 27. If a subtraction shows up as a date such as "7/3/1900", change the cell format to "General".
Excel dates only work from January 1, 1900 onward. For earlier dates, use the calculator on this page or Python.
How to calculate it in Google Sheets
| Date to check | 2026-07-04 |
| Day of the week | =TEXT(B1,"dddd") |
| Date to check | 2026-07-04 |
| Weekday number (1 = Sunday to 7 = Saturday) | =WEEKDAY(B1) |
| Date to check | 2026-07-04 |
| Day of the year | =B1-DATE(YEAR(B1),1,1)+1 |
| Days in the year | =DATE(YEAR(B1),12,31)-DATE(YEAR(B1),1,1)+1 |
| Days left | =B3-B2 |
| Date to check | 2026-07-04 |
| Day of the year | =B1-DATE(YEAR(B1),1,1)+1 |
| Occurrence n | =INT((B2-1)/7)+1 |
If a subtraction shows up as a date, change it to a number with Format > Number > Number in the menu.
How to calculate it in Python
import datetime
year, month, day = 2026, 7, 4 # the date to check
# --- Method 1: use the standard datetime library ---
target_date = datetime.date(year, month, day)
weekday_names = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
weekday_name = weekday_names[target_date.weekday()]
print(f"{target_date:%B} {day}, {year} falls on a {weekday_name}")
day_of_year = target_date.timetuple().tm_yday # day of the year
days_in_year = datetime.date(year, 12, 31).timetuple().tm_yday # days in that year
print(f"Day {day_of_year} of {days_in_year}, with {days_in_year - day_of_year} days left in the year")
nth = (day_of_year - 1) // 7 + 1 # which occurrence of the weekday
print(f"It is {weekday_name} #{nth} of the year")
# --- Method 2: use Zeller's congruence ---
q, m, y = day, month, year
if m <= 2: # January and February count as months 13 and 14 of the year before
m += 12
y -= 1
K, J = y % 100, y // 100
h = (q + 13 * (m + 1) // 5 + K + K // 4 + J // 4 - 2 * J) % 7
zeller_names = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']
print(f"Zeller's congruence also gives {zeller_names[h]}")
How to write it in LaTeX and other math languages (copy and paste)
h = (q + ⌊13(m + 1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ − 2J) mod 7
h = \left( q + \left\lfloor \frac{13(m+1)}{5} \right\rfloor + K + \left\lfloor \frac{K}{4} \right\rfloor + \left\lfloor \frac{J}{4} \right\rfloor - 2J \right) \bmod 7
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>h</mi><mo>=</mo>
<mrow>
<mo>(</mo>
<mi>q</mi><mo>+</mo>
<mrow><mo>⌊</mo><mfrac><mrow><mn>13</mn><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow><mn>5</mn></mfrac><mo>⌋</mo></mrow>
<mo>+</mo><mi>K</mi>
<mo>+</mo><mrow><mo>⌊</mo><mfrac><mi>K</mi><mn>4</mn></mfrac><mo>⌋</mo></mrow>
<mo>+</mo><mrow><mo>⌊</mo><mfrac><mi>J</mi><mn>4</mn></mfrac><mo>⌋</mo></mrow>
<mo>−</mo><mn>2</mn><mo>⁢</mo><mi>J</mi>
<mo>)</mo>
</mrow>
<mspace width="0.3em"/><mo>mod</mo><mspace width="0.3em"/><mn>7</mn>
</mrow>
</math>
h = (q + floor(13(m + 1)/5) + K + floor(K/4) + floor(J/4) - 2J) mod 7
h = Mod[q + Floor[13 (m + 1)/5] + K + Floor[K/4] + Floor[J/4] - 2 J, 7]
h := (q + floor(13*(m + 1)/5) + K + floor(K/4) + floor(J/4) - 2*J) mod 7;
h = mod(q + floor(13*(m + 1)/5) + K + floor(K/4) + floor(J/4) - 2*J, 7);
h = (q + ⌊13(m + 1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ - 2J) mod 7
n = ⌊(d − 1)/7⌋ + 1
n = \left\lfloor \frac{d - 1}{7} \right\rfloor + 1
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>n</mi><mo>=</mo>
<mrow><mo>⌊</mo><mfrac><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow><mn>7</mn></mfrac><mo>⌋</mo></mrow>
<mo>+</mo><mn>1</mn>
</mrow>
</math>
n = floor((d - 1)/7) + 1
n = Floor[(d - 1)/7] + 1
n := floor((d - 1)/7) + 1;
n = floor((d - 1)/7) + 1;
n = ⌊(d - 1)/7⌋ + 1
365 = 7 × 52 + 1, 366 = 7 × 52 + 2
365 = 7 \times 52 + 1, \quad 366 = 7 \times 52 + 2
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mn>365</mn><mo>=</mo>
<mn>7</mn><mo>×</mo><mn>52</mn><mo>+</mo><mn>1</mn>
<mo>,</mo><mspace width="0.7em"/>
<mn>366</mn><mo>=</mo>
<mn>7</mn><mo>×</mo><mn>52</mn><mo>+</mo><mn>2</mn>
</mrow>
</math>
365 = 7 xx 52 + 1, 366 = 7 xx 52 + 2
QuotientRemainder[365, 7]
iquo(365, 7); irem(365, 7);
q = floor(365/7); r = mod(365, 7);
365 = 7 × 52 + 1
How to have ChatGPT do the calculation
You are a date calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). For July 4, 2026, find the following: 1. The day of the week 2. Which day of the year it is, and how many days are left until New Year's Eve 3. Which occurrence of that weekday it is in the year (and how many times that weekday comes in the whole year) Show the code you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
