ISO Week Numbers, and Why Your Spreadsheet Disagrees With Your Colleague
A week number is not a number. It is half of a pair, and the missing half is where the bugs live.
Almost everyone who uses week numbers assumes a week number is a number. It is not. It is half of a pair, and the missing half is the reason your dashboard says week 53 while your colleague's spreadsheet says week 1, both for the same Thursday.
The rule that produces this is short enough to state in one line. Under ISO 8601, weeks start on Monday, and week 1 of a year is the week containing that year's first Thursday. Two equivalent formulations of the same rule are often easier to apply: week 1 is the week containing 4 January, and week 1 is the first week with at least four of its days in the new year. All three definitions pick out the same week, always.
The consequence nobody plans for: the ISO week-year
Because a 7-day week cannot be sliced by a 365-day year, the Thursday rule forces some days at the edges of December and January into the neighbouring year's week numbering. This is not an edge case that shows up once a decade; it happens most years.
| Date | Weekday | ISO week-date |
|---|---|---|
| 2020-12-31 | Thursday | 2020-W53-4 |
| 2021-01-01 | Friday | 2020-W53-5 |
| 2021-01-04 | Monday | 2021-W01-1 |
| 2024-12-30 | Monday | 2025-W01-1 |
| 2026-12-31 | Thursday | 2026-W53-4 |
| 2027-01-01 | Friday | 2026-W53-5 |
Read the fourth row carefully. 30 December 2024 belongs to ISO week 1 of 2025. The calendar year is 2024 and the ISO week-year is 2025, and any system that stores the week number next to a calendar year taken from the same date has just filed that Monday under 2024-W01—a week that occurred twelve months earlier.
The ISO week-year is a distinct calendar that happens to share most of its days with the Gregorian one. It always contains a whole number of weeks: 364 days in a 52-week year, 371 in a 53-week year. It never splits a week. That property is exactly why it is useful for operational reporting, and exactly why it cannot line up with January to December.
Which years have 53 weeks
A year gets a 53rd ISO week when 1 January falls on a Thursday, or when it is a leap year beginning on a Wednesday. Between 2000 and 2040 the 53-week years are 2004, 2009, 2015, 2020, 2026, 2032 and 2037. The gaps are always five or six years, and over a full 400-year Gregorian cycle exactly 71 of 400 years have 53 weeks—a shade under 18%.
2026 is one of them. If your reporting stack was built after 2020, this may be the first year it has ever emitted a week 53, and code that assumed 1 <= week <= 52—in a validation rule, a lookup table of 52 rows, a chart axis, a partition key—is meeting its first counterexample now rather than in testing.
The other convention, and why Excel gives two answers
The US and broadcast convention is different and equally internally consistent: week 1 is the week containing 1 January, and weeks typically start on Sunday. Under that scheme there is no borrowing across year boundaries at all—1 January is always in week 1 of its own calendar year—at the cost of week 1 sometimes being a stub of one or two days.
Microsoft documents both systems in one function. Excel's WEEKNUM defaults to what the documentation calls System 1, where "the week containing January 1 is the first week of the year, and is numbered week 1." Passing a return_type of 21 switches it to System 2, where "the week containing the first Thursday of the year is the first week of the year." Excel also ships a separate ISOWEEKNUM function that always returns the ISO value. So the same spreadsheet application, on the same date, will produce different week numbers depending on which of three functions someone typed—and none of them return the ISO week-year, which is the piece that actually disambiguates the result.
Programming languages replicate the split. In Python, date.isocalendar() returns the ISO triple and strftime("%V") returns the ISO week, while %U counts weeks from the first Sunday and %W from the first Monday, both numbering any leading partial week as week 0. For 31 December 2026 those three format codes return 53, 52 and 52 respectively. For 1 January 2026 they return 01, 00 and 00. If one service in your pipeline formats with %U and another with %V, they will agree for most of the year and diverge at both ends of it, which is the worst possible failure schedule: rare enough to escape testing, reliable enough to happen every January.
What this actually breaks
Year-over-year comparisons drift. Comparing "week 36 this year" against "week 36 last year" compares two date ranges that can sit up to six days apart, because the Monday that starts a given ISO week slides one day earlier each common year and two earlier across a leap year, then jumps forward five or six days when a 53-week year intervenes. Week 36 begins on 31 August in 2020, 6 September in 2021, 1 September in 2025 and 31 August again in 2026. For weekly retail or traffic data with strong day-of-month or holiday structure, a six-day offset is not noise; it can move a promotion, a payday or a public holiday from one bucket into another. The comparison looks like an apples-to-apples weekly series and is not.
53-week years break the alignment entirely. After a 53-week year, every subsequent week number refers to a period shifted a week from its counterpart in the prior year. This is well understood in retail, where the 4-5-4 calendar is standard. The National Retail Federation's calendar adds a 53rd week when four or more days remain in January after laying out 52 weeks; recent 53-week retail years were 2006, 2012, 2017 and 2023. Note what the NRF then recommends: rather than comparing week 40 to week 40, restate the 53-week year "by pushing each week of the 53-week year back one week, thereby ignoring the first week of the fiscal year." The professional answer to the alignment problem is to deliberately throw away a week, which tells you how little a naive week-to-week comparison is worth.
Cross-system joins silently misfile rows. A pipeline that groups events by ISO week produces a bucket labelled 2026-W53 containing 28 December 2026 through 3 January 2027. A finance system using the Jan-1 convention files those same last three days under week 1 of 2027. Join the two on (year, week) and the rows do not match; worse, if both sides store only the calendar year, some of them match the wrong partner and the discrepancy shows up as a small unexplained variance rather than a failed join.
"Week ending" is ambiguous too. An ISO week ends on Sunday. A broadcast week ends on Saturday. Many payroll and rota systems end on Friday. A column called week_ending with no convention recorded anywhere is a bug waiting for its first cross-team report.
How to stop having this argument
- Store the pair, not the number. Persist
(iso_year, iso_week)together, or better, store the actual date of the week's Monday and derive the label at display time. A date is unambiguous; a week number is not. - Write it the ISO way.
2026-W53is a defined notation. "Week 53" in a subject line is not, and "week 53 of 2027" is wrong for a week that is entirely inside 2026 by three days. - Say which convention in the spec, then test the boundary. The test cases that matter are 1-3 January, 29-31 December, and any date in a 53-week year. Every one of the divergences above is caught by six test dates.
- For year-over-year, align on something real. Compare equivalent date ranges, or adopt an explicit retail calendar with a documented restatement rule, rather than trusting that week N means the same thing in two different years.
- Never validate week numbers against 52. The upper bound is 53.
You can check any of this against the Week Number Calculator, which returns the ISO week for a given date—try 1 January 2027 and note the year it belongs to. The Working Days Calculator and Date Difference Calculator are the tools to reach for when the honest answer to "which week was that" turns out to be "compare the date ranges instead."
The underlying point is that ISO 8601 did not create this problem; it solved a real one, which is that businesses need a period of exactly seven days that never splits, and a year cannot supply an integer number of those. Something has to give at the boundary. ISO chose to let the week win and the year bend. The US convention chose the opposite. Both are coherent. The failure is only ever in assuming everyone else made the same choice you did.
Related tools
- Week Number Calculator — ISO week number for any date
- Working Days Calculator — business days between two dates
- Date Difference Calculator — days, weeks and months between dates
Sources and further reading
Figures and definitions on this page are drawn from the following primary sources. If you find something out of date, tell us and we will correct it.