How ISO week numbers work

Weeks start on Monday, week 1 holds the first Thursday, and the days around New Year can belong to a different year from the one on the calendar.

Week numbers look like the simplest thing in the calendar, and they are the source of a surprising share of scheduling disputes. The reason is that there is more than one system, and the two most common disagree for up to a week every year. The system used in most of Europe, in logistics, in manufacturing planning and by many payroll departments is the one defined in ISO 8601. The week number tool gives today’s ISO week and the dates of any week you name; this guide explains what it is computing.

The three rules

ISO weeks are defined by three decisions. Weeks start on Monday and end on Sunday. Weeks are numbered from 1 within a week-based year, which is not always the calendar year. And week 1 is the week that contains the first Thursday of January. Everything else follows from these. Equivalent ways of stating the third rule, which you will see in documentation, are that week 1 contains 4 January, or that it is the first week with a majority of its days in the new year. All three say the same thing.

What happens at the year boundary

Because weeks do not break at midnight on 31 December, the first few days of January can belong to the last week of the previous year, and the last few days of December can belong to week 1 of the next. Consider the turn of 2026. The first of January 2026 is a Thursday, so the week of Monday 29 December 2025 to Sunday 4 January 2026 is week 1 of 2026. Someone looking at 30 December 2025 on a wall calendar is in week 1 of 2026 by ISO reckoning, and a report labelled “2025 week 53” for that date would be wrong, because 2025 has no week 53.

The other direction is just as real. The first of January 2027 is a Friday, so it falls in the week beginning Monday 28 December 2026, which is week 53 of 2026. The first full week of 2027 is week 1, starting on 4 January. Any system that derives the year from the date and the week from the ISO rule will produce “2027-W53” for New Year’s Day 2027, which does not exist. The year has to be the week-based year.

Years with 53 weeks

A year has 52 weeks and one day, or two days in a leap year. Most years therefore fit 52 ISO weeks with the spare days absorbed by the neighbouring years. A year gets a 53rd week when it has enough spare days to contain a full extra Thursday, which happens when 1 January falls on a Thursday, or on a Wednesday in a leap year. Equivalently, a year has 53 weeks when it starts or ends on a Thursday. 2026 starts on a Thursday and has 53 weeks. 2020 was a leap year starting on a Wednesday and also had 53. Across the 400-year Gregorian cycle, 71 years have 53 weeks, roughly one in every five or six.

Fifty-three-week years are where payroll and reporting systems break. Weekly pay on a 52-week assumption underpays by a week; annual budgets split into 52 weekly buckets have nowhere to put the 53rd; a comparison of “week 45 this year with week 45 last year” shifts by a day or two in the calendar, and by a whole week after a 53-week year.

The other systems

The United States, Canada and much of the English-speaking world outside Europe use a different convention: weeks start on Sunday and week 1 is the week containing 1 January, however short it is. Under that rule week 1 can be a single day, every year has 53 or 54 numbered weeks, and the first week of the year is rarely a full one. A third convention, used in some Middle Eastern countries, starts weeks on Saturday. All of these are internally consistent; the trouble is when two of them meet in the same spreadsheet.

Excel is the usual meeting place. Its WEEKNUM function defaults to the US system. To get ISO weeks you need WEEKNUM(date, 21) or, in recent versions, ISOWEEKNUM. Google Sheets has the same pair. Most programming languages offer both as well, under names that do not make the distinction obvious, which is how an export from one system becomes a mystery in another.

The YYYY trap

Many date-formatting libraries, including Java’s and the one in many Unix tools, distinguish yyyy, the calendar year, from YYYY, the ISO week-based year. They are equal for roughly 360 days of the year and differ around New Year, which is exactly when nobody is watching the output. A date printed as YYYY-MM-dd shows 31 December 2026 as 2026-12-31 but 28 December 2026 as 2026-12-28 and, since both days are in week 53 of 2026, happens to be right; print 1 January 2027 the same way and it comes out as 2026-01-01. Use yyyy unless the week number is on the same line.

Working with week numbers safely

Write the week-based year with the week, in the ISO form 2026-W53, and never derive the year from the calendar date on its own. When a report is “by week”, say which convention it uses in the heading. Check whether the current year has 53 weeks before building anything that assumes 52. And when a date near New Year looks wrong by a week, suspect the convention before suspecting the data. The calendar and the year calendar show ISO week numbers down the side, which makes the boundary cases visible at a glance.

Sources

About the author

UnixClock is built, maintained and written by Niraj Kumar, a software developer who started it to replace the hand calculations and half-remembered offsets that kept going wrong across time zones. More about the site.

Frequently asked questions

Which week is week 1 in the ISO system?

The week, running Monday to Sunday, that contains the first Thursday of January. Equivalently, the week containing 4 January.

Why does 2026 have 53 ISO weeks?

Because 1 January 2026 is a Thursday. A year has 53 weeks when it begins on a Thursday, or on a Wednesday in a leap year; otherwise it has 52.

How do ISO weeks differ from the US system?

US weeks start on Sunday and week 1 is whichever week contains 1 January, however short. ISO weeks start on Monday and week 1 must contain a Thursday, so it is always a majority-new-year week.

How do I get ISO week numbers in Excel?

Use ISOWEEKNUM(date), or WEEKNUM(date, 21). The plain WEEKNUM default uses the US convention.

Related tools