Skip to content

Day of Week Calculator

Find the day of the week for any date, plus ISO week number, day of year, and leap year status.

Date details

Updates as you change inputs
Mode
What do you want to know? ?
Date
Pick a date
Quick picks ?
Display (optional)
Week starts on

Formula

h = ( q + 13(m + 1) 5 + K + K 4 + J 4 2J ) mod 7
h
Day of the week (0 = Saturday, 1 = Sunday, … 6 = Friday)
q
Day of the month
m
Month (3 = March, 4 = April, … 14 = February). January and February are treated as months 13 and 14 of the previous year.
K
Year of the century (year mod 100)
J
Zero-based century (year div 100)
WORKED EXAMPLE — YOUR DATE
  1. q (day) =
  2. m (adjusted month) =
  3. K (year mod 100) =
  4. J (century) =
  5. Sum before mod 7 =
  6. h = sum mod 7 =
  7. Weekday =

This is Zeller's congruence for the Gregorian calendar. January and February shift into the previous year so the leap-year rule always lands on the last month of the "year" — that small bookkeeping trick is what keeps the formula to one line. Dates before the 1582 Gregorian reform use a different variant; modern browsers and this calculator use the proleptic Gregorian rule throughout.

Examples

How It Works

The day of week calculator uses the JavaScript Date object to determine which day of the week any given date falls on. It works for dates far in the past or future.

The ISO week number follows the ISO 8601 standard: weeks start on Monday, and week 1 is the week containing January 4th (or equivalently, the week with the year's first Thursday). This means December 31 can be in week 1 of the next year.

Day of the year counts from January 1 (day 1) through December 31 (day 365, or 366 in a leap year). Leap years occur every 4 years, except for years divisible by 100 — unless also divisible by 400 (so 2000 was a leap year, but 1900 was not).

Tips & Best Practices

Use this to plan events — check which day of the week a future date falls on before booking.
ISO week numbers are used in business scheduling, especially in Europe.

Frequently Asked Questions

How far back or forward does this work?

JavaScript's Date object handles dates from approximately 271,821 BCE to 275,760 CE. For practical purposes, it works for any date you'd need.

ISO weeks can be counterintuitive at year boundaries. December 31 can be in week 1 of the next year, and January 1 can be in week 52 or 53 of the previous year. This is correct per ISO 8601.