Skip to main content

Week Number Calculator

Find the ISO week number, day of year, days remaining, quarter and more for any date.

Reviewed by · Last reviewed

W21
ISO Week Number
144
Day of Year
221
Days Remaining
Sunday
Day of Week
Q2
Quarter
No
Leap Year

How to Use the Week Number Calculator

  1. Pick any date in the date picker - defaults to today.
  2. Read the stat panel: ISO week number (1-53), day of year (1-366), days remaining in the year, day of week, calendar quarter (Q1-Q4), and whether the year is a leap year.
  3. Try different dates by re-selecting to see how year boundaries and leap days move the numbers.

Dates near year boundaries are where the ISO rule gets interesting: January 1, 2023 is ISO week 52 of 2022 (yes, really); December 31, 2018 is ISO week 1 of 2019. The tool handles those edge cases automatically.

The Algorithm Behind The Numbers

ISO 8601 week numbering is not "divide day-of-year by 7." The canonical algorithm is: take the Thursday of the week that contains your target date (Monday-based weeks), note what calendar year that Thursday falls in - that is the "week-numbering year." Then find January 4 of that same year (January 4 is always in ISO week 1 by construction), figure out which Monday starts that week, and count how many seven-day blocks separate your week from that anchor. The reason: defining week 1 as "the week containing the first Thursday" guarantees that weeks 1 through 52 or 53 always contain a majority of their days in the stated year, eliminating the awkwardness of a "half week" at either boundary. The component uses a compact implementation of exactly this rule, working from getDay() and a temporary Date clone so daylight saving transitions never shift the answer.

Who Actually Cares About Week Numbers

  • European payroll and scheduling software - many German, Scandinavian, and Dutch companies identify pay periods, shifts, and project milestones by "week 14" or "KW 23" (Kalenderwoche).
  • Agile/scrum teams that run one- or two-week sprints and label sprint numbers by the first ISO week they cover.
  • Manufacturing lot codes. Date codes on electronics and consumables often read "YYWW" (e.g. 2415 = 2024 week 15) - you see this on microchips, canned food, and pharmaceuticals.
  • Financial reporting where firms close books on a 4-4-5 or 4-5-4 week pattern aligned to ISO weeks rather than calendar months.
  • Pregnancy tracking - "38 weeks" is the standard gestational milestone, always counted as weeks.
  • Project retrospectives where "what did we ship in week 37?" is easier to answer than "what did we ship September 9 through 15?"

Gotchas That Surprise People

  • ISO is not US numbering. US/Canadian calendars often use week 1 = the week containing January 1, Sunday-start. That system's "week 1" and ISO's "week 1" can disagree by a full week. When a US office emails "week 1" to a German office, they may mean different dates.
  • 53-week years. Years starting on a Thursday (in a regular year) or a Wednesday (in a leap year) contain 53 ISO weeks. Recent examples: 2015, 2020, 2026. A payroll system that hard-codes 52 weeks will break.
  • January 1 may be in the previous year's week 52 or 53. January 1-3 of some years belong to the prior year's final ISO week, because the Thursday rule pushes them there. Filing "annual reports for week 1" can miss those first days.
  • The Date.prototype.getDay() method returns 0 for Sunday, not 1 for Monday - a common source of off-by-one bugs when implementing ISO week math by hand.
  • Microsoft Excel's WEEKNUM function defaults to US numbering; you have to pass WEEKNUM(A1, 21) for ISO. ISOWEEKNUM is a separate function added in Excel 2013.

ISO 8601, US Weeks, And Why There Are Two Systems

ISO 8601 (ISO 8601-1:2019) is the international standard. Weeks run Monday through Sunday; week 1 contains the year's first Thursday, equivalently the week containing January 4; years have 52 or 53 weeks. The format 2024-W15 or 2024-W15-3 (where -3 is Wednesday) is an ISO-valid expression. The ISO week-numbering year may differ from the Gregorian calendar year near New Year's: January 1, 2023 was ISO 2022-W52. US/Canadian week numbering is informal: weeks start Sunday, week 1 contains January 1, and the year has 53 or 54 partial weeks. Canadian federal HR uses ISO; US commercial software overwhelmingly uses the US system. The week containing a given date is not the same span in each.

Week Numbers In Excel, Python, And The Browser

Python's datetime.isocalendar() returns a named tuple (year, week, weekday) and is the right tool in a notebook. Pandas exposes .dt.isocalendar() on Series for vectorised operation on a column of dates. Excel has ISOWEEKNUM(date) for ISO and WEEKNUM(date, [return_type]) for US and other systems - the return_type argument is where bugs hide. Moment.js's .isoWeek() and date-fns's getISOWeek() wrap the same algorithm. The native browser has no direct ISO week API - Intl.DateTimeFormat does not expose week numbers (a known gap that the upcoming Temporal proposal will close via Temporal.PlainDate.prototype.weekOfYear). Until Temporal ships, the compact implementation in this page, or a 10-line helper, is the way. This page is the right pick when you want the answer in three seconds without opening DevTools or Excel.

Frequently Asked Questions

Why is January 1 sometimes week 52 of the previous year?

Because ISO 8601 defines week 1 as the week containing the year's first Thursday, not the week containing January 1. If January 1 is a Friday, Saturday, or Sunday, the week it sits in has its Thursday in the previous year, so ISO assigns it to week 52 (or 53) of that previous year. January 1, 2023 was a Sunday and belongs to ISO week 52 of 2022. This is working as designed, not a bug.

How do I know whether a year has 53 ISO weeks?

A year has 53 ISO weeks if it starts on a Thursday (regular year) or on a Wednesday (leap year). Equivalently, a year has 53 weeks when January 1 is a Thursday or December 31 is a Thursday. Recent 53-week years: 2009, 2015, 2020, 2026. The tool shows the week number directly; if you pick December 31 of a given year and it reads 53, you have your answer.

Why does this tool use Monday as the start of the week?

Because ISO 8601 specifies Monday-start, chosen to match most European civil calendars and to make the Thursday-anchor rule elegant. The US/Canada convention is Sunday-start. For a US-style week number use Excel WEEKNUM with return_type 1 (Sunday-start) - this tool only does ISO.

What is "day of year" good for?

Day of year (also called ordinal date or Julian day-of-year) gives you a 1-366 integer. It is handy for quick subtraction between two dates in the same year ("day 250 minus day 100 equals 150 days apart"), for reading weather station data where ordinal days are common, and for the old COBOL/mainframe date format YYDDD. Astronomers use a different "Julian day number" that counts days since November 24, 4714 BC - unrelated despite sharing a name.

Does the tool respect my timezone for "today"?

The default date is your system-local "today" as reported by the browser. If you travel across the International Date Line, the default shifts accordingly. Week number assignment itself is calendar-based, not timezone-based - January 1 local is January 1 local, regardless of what it is in UTC. If you are comparing numbers with a colleague on the other side of the world at 11 PM local, you may be in different calendar days.

How are quarters calculated here?

Standard calendar quarters: Q1 is January-March, Q2 is April-June, Q3 is July-September, Q4 is October-December. The tool derives this from the calendar month, not from ISO weeks - "quarter 1" is not "weeks 1 through 13" in the ISO sense. Fiscal quarters at companies with non-calendar fiscal years (Apple Q1 ends in December, for example) are different and not covered by this tool.

Why does the tool say "leap year" even though my date is in March?

Leap year is a property of the whole year, not the date you pick. 2024 is a leap year because 2024 is divisible by 4 and not divisible by 100 (or it is divisible by 400). Every date in 2024 shows "leap year: yes" even though the actual leap day is only February 29. The flag is included because it answers the common follow-up question "does this year have a Feb 29?"

Is my date sent to a server for calculation?

No. The week number, day of year, quarter, and leap year computations are pure functions of the input date, computed in the Preact island with native JavaScript Date methods. No fetch, no backend call, no third-party library. The page works fully offline once the JavaScript bundle is cached.

Can I use this for historical dates like 1900 or 2100?

Yes, within reason. JavaScript Date supports roughly ±100 million days from the epoch, and ISO 8601 week rules are defined for the proleptic Gregorian calendar the entire span. Dates before the Gregorian reform (October 15, 1582) are technically in the Julian calendar in historical records, but the tool will still compute an ISO week number using proleptic Gregorian rules - just do not expect it to match period documents.

What format should I use if I want to write an ISO week in text?

The canonical format is YYYY-Www, for example 2024-W15 for week 15 of 2024. Add -D for the day within the week: 2024-W15-3 is Wednesday of week 15. The W is always capital. This format is understood by ISO 8601 parsers, by some programming languages natively (Python isoformat, Go formatting), and by most standards bodies. It is not yet parsed by the JavaScript Date constructor; you will need a helper.

More Date & Time