The three rules
The whole system reduces to three rules:
- Weeks run Monday to Sunday. Monday is day 1, Sunday is day 7.
- Week 1 is the week that contains January 4. An equivalent statement: week 1 is the week that contains the year's first Thursday. Both follow from the underlying definition — week 1 is the first week with a majority (4 or more) of its days in the new year.
- Weeks are numbered consecutively from week 1 to week 52 or 53, and every date belongs to exactly one week.
That third rule sounds trivial, but it is the reason the standard exists: no split weeks, no "week 0", no ambiguity. Every week of every year has exactly seven days and exactly one number.
The ISO week-year — why January 1 can be in week 52
Because week 1 must contain January 4, up to three days of late December can belong to next year's week 1, and up to three days of early January can belong to last year's final week. The year a week belongs to is called the ISO week-year, and near New Year it can differ from the calendar year of the date.
Two concrete examples:
- January 1, 2027 falls on a Friday. The first Thursday of 2027 is January 7, so week 1 of
2027 starts Monday, January 4. New Year's Day 2027 therefore belongs to week 53 of 2026 —
its ISO week date is
2026-W53-5. - December 29, 2025 falls on a Monday, and that week contains January 1, 2026 (a Thursday).
So December 29–31, 2025 already belong to week 1 of 2026:
2026-W01.
The practical consequence: when you label anything by week number near the year boundary, always carry
the week-year with it. "Week 1" is ambiguous; "2026-W01" is not. This is also why software
distinguishes the ISO week-year (Excel: =YEAR(A1-WEEKDAY(A1,2)+4), Python:
date.isocalendar().year) from the plain calendar year.
52 or 53 weeks
A common year is 52 weeks + 1 day; a leap year is 52 weeks + 2 days. Those leftover days accumulate, and every 5–6 years the alignment produces a year with 53 numbered weeks. The test is simple: a year has 53 ISO weeks if January 1 falls on a Thursday, or if it is a leap year and January 1 falls on a Wednesday. Equivalently: if December 28 is in week 53. (December 28 is always in the last week of the ISO year — a handy fact for programmers.)
2026 has 53 weeks. The 53-week years around now: 2020, 2026, 2032, 2037. The full list and the planning consequences are in how many weeks in a year and the 53-week payroll guide.
The YYYY-Www-D format
ISO 8601 defines a compact notation for week dates:
| Form | Example (today) | Meaning |
|---|---|---|
YYYY-Www | 2026-W29 | Week 29 of 2026 |
YYYY-Www-D | 2026-W29-4 | Thursday (day 4) of that week |
YYYYWwwD (basic) | 2026W294 | Same, without separators |
The "W" is mandatory — it is what distinguishes a week date from an ordinary calendar date. Weekday
digits run 1 (Monday) to 7 (Sunday). Informal short forms like 26W29 and the
manufacturing code 2629 are descendants of this notation; the full family is covered in
week number formats.
Edge cases, year by year
Where January 1 lands tells you everything about the year's first days:
| Jan 1 falls on… | Jan 1 belongs to | Week 1 starts |
|---|---|---|
| Monday | Week 1 | January 1 |
| Tuesday | Week 1 | December 31 |
| Wednesday | Week 1 | December 30 |
| Thursday | Week 1 | December 29 (53-week year) |
| Friday | Week 52/53 of previous year | January 4 |
| Saturday | Week 52/53 of previous year | January 3 |
| Sunday | Week 52/53 of previous year | January 2 |
So the latest a New Year's Day can sit in the old year's numbering is W53-5 (Friday), and
week 1 never starts earlier than December 29 or later than January 4.
Computing ISO weeks in code
Never implement the rules by hand — every mainstream platform has them built in:
# Python
from datetime import date
date.today().isocalendar() # (year, week, weekday)
-- SQL Server
SELECT DATEPART(ISO_WEEK, GETDATE());
-- PostgreSQL (WEEK is ISO by definition)
SELECT EXTRACT(WEEK FROM now()), EXTRACT(ISOYEAR FROM now());
// JavaScript (no built-in; the standard snippet)
function isoWeek(d) {
const t = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
const day = (t.getUTCDay() + 6) % 7; // Mon=0
t.setUTCDate(t.getUTCDate() - day + 3); // Thursday of this week
const jan4 = new Date(Date.UTC(t.getUTCFullYear(), 0, 4));
const w1mon = new Date(jan4.getTime() - ((jan4.getUTCDay() + 6) % 7) * 864e5);
return { year: t.getUTCFullYear(),
week: Math.floor((t - w1mon) / 864e5 / 7) + 1 };
}
' Excel / Google Sheets
=ISOWEEKNUM(A1) ' week number
=YEAR(A1-WEEKDAY(A1,2)+4) ' ISO week-year
The JavaScript trick is worth understanding: shift the date to the Thursday of its week, and the whole problem collapses — that Thursday's calendar year is the ISO week-year, and the week number is its distance from the year's first Thursday. Excel details (including the WEEKNUM pitfalls) are in week numbers in Excel.
Where the standard comes from
Numbered weeks were common in Northern European industry through the 20th century — factories and shipping firms planned by "calendar week" (German Kalenderwoche, KW) long before computers. But different countries anchored week 1 differently, so the same shipment could be "week 4" in one office and "week 5" in another. ISO 8601, first published in 1988 (consolidating older standards like ISO 2015), standardised the Monday start and the January-4 rule, and its week date system spread with international trade and software. Today it is the default in most of Europe, in logistics and manufacturing worldwide, and in virtually every programming language and database.