Skip to content
Calendar

ISO Week Numbers: How They Work and Why Some Years Have 53 Weeks

ISO weeks start on Monday and week 1 is the week with the year's first Thursday. Why 1 January 2027 falls in week 53 of 2026, and how to get the week number in Excel, code and SQL.

An ISO week number identifies a Monday-to-Sunday week within a year. Week 1 is the week that contains the year’s first Thursday (equivalently, the week containing 4 January), so a year has either 52 or 53 ISO weeks, and the first or last few days of a calendar year can belong to a week of the neighbouring year.

The rules come from ISO 8601, the international standard for writing dates and times. The site’s week number page shows the current ISO week; this article explains how the number is worked out.

The three rules

  1. Weeks start on Monday and end on Sunday (the seven-day week itself is far older than the standard). Days are numbered 1 (Monday) to 7 (Sunday).
  2. Week 1 is the week containing the first Thursday of the year. Because a week has seven days and Thursday is the middle one, this is the same as saying week 1 is the first week with at least four days in the new year, or the week that contains 4 January.
  3. Every week belongs entirely to one year. There are no partial weeks. The year a week belongs to is called the ISO week-numbering year, and it is the calendar year in which that week’s Thursday falls.

Rule 3 is the one that causes surprises. Near New Year, the ISO week-year and the calendar year can disagree for up to three days.

Worked examples: the 2026/2027 boundaries

1 January 2026 is a Thursday, so the week containing it is week 1 of 2026 — even though that week starts on Monday, 29 December 2025.

DateWeekdayISO week
29 December 2025Monday2026-W01-1
1 January 2026Thursday2026-W01-4
4 January 2026Sunday2026-W01-7
5 January 2026Monday2026-W02-1
28 December 2026Monday2026-W53-1
31 December 2026Thursday2026-W53-4
1 January 2027Friday2026-W53-5
3 January 2027Sunday2026-W53-7
4 January 2027Monday2027-W01-1
31 December 2027Friday2027-W52-5
2 January 2028Sunday2027-W52-7
3 January 2028Monday2028-W01-1

So 29–31 December 2025 belong to ISO year 2026, while 1–3 January 2027 belong to ISO year 2026 and 1–2 January 2028 to ISO year 2027. The notation 2026-W53-5 is the ISO 8601 week date format: week-year, W plus two-digit week, then the day number. You can check these against the 2026 calendar and the January 2027 calendar.

A common bug follows from this: formatting a date as “calendar year + ISO week” labels 1 January 2027 as week 53 of 2027, a week that does not exist. Always pair an ISO week with the ISO week-year.

Why some years have 53 weeks

A common year has 365 days, which is 52 weeks plus one day; a leap year has 52 weeks plus two days. Those spare days accumulate until a year needs a 53rd week. Under the Thursday rule, a year has 53 ISO weeks if it starts on a Thursday, or if it is a leap year that starts on a Wednesday. Equivalently, it has 53 weeks when 31 December falls on a Thursday, or on a Friday in a leap year.

2026 starts on a Thursday, which is why it has a week 53. The 53-week years from 2000 to 2050 are:

2004, 2009, 2015, 2020, 2026, 2032, 2037, 2043, 2048

That is 9 out of 51 years. Over the full 400-year Gregorian cycle, 71 of 400 years have 53 weeks — roughly one year in five or six, at intervals of five or six years.

This matters for anything that reports by week: payroll on weekly cycles, retail “same week last year” comparisons, and production plans indexed by week number all have to handle a week 53 that appears only occasionally.

Other week-numbering conventions

ISO 8601 is not the only system in use. The other common one, typical in the United States, uses different rules:

ISO 8601Common US convention
First day of weekMondaySunday
Week 1Week containing the first ThursdayWeek containing 1 January
Partial weeksNever; weeks can cross into the next or previous yearYes; week 1 and the last week may be short
Weeks per year52 or 5353, and occasionally 54

Under the US convention, Friday 1 January 2027 is week 1 of 2027, and Sunday 3 January 2027 is already week 2. Under ISO, both are in week 53 of 2026. The two systems can disagree by a week or more at any point in the year, so when a colleague says “week 14”, it is worth confirming which system they mean.

Spreadsheets and databases default to different conventions, which is a frequent source of mismatched reports:

  • Excel: WEEKNUM(date) with no second argument uses Sunday-start weeks with week 1 containing 1 January. ISOWEEKNUM(date) returns the ISO week, as does WEEKNUM(date, 21).
  • MySQL: WEEK(date) defaults to mode 0 (Sunday start, range 0–53). WEEK(date, 3) is the ISO definition: Monday start, range 1–53, week 1 being the first week with four or more days in the year.
  • Python: strftime('%U') counts Sunday-start weeks, with days before the first Sunday in week 0. %V and %G give the ISO week and ISO year.

Where week numbers are used

Week numbers are standard in everyday business and school planning in much of northern Europe, notably in the Nordic countries and Germany, where printed diaries and calendars routinely show them and “week 12” is a normal way to set a deadline. They are less common in everyday conversation in the United States and the United Kingdom, though they are widely used in manufacturing, logistics and retail planning everywhere. ISO 8601 week dates are also used in data formats and APIs that need an unambiguous week identifier.

Getting the ISO week in software

Excel / Google Sheets

=ISOWEEKNUM(A1)

Excel returns only the week, not the week-year. For a full label, take the year of the Thursday in the same week: =YEAR(A1 - WEEKDAY(A1, 2) + 4) & "-W" & TEXT(ISOWEEKNUM(A1), "00").

JavaScript

JavaScript has no built-in ISO week function. This version works in UTC to avoid daylight saving surprises:

function isoWeek(date) {
  const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
  const day = d.getUTCDay() || 7;            // Monday = 1 … Sunday = 7
  d.setUTCDate(d.getUTCDate() + 4 - day);    // move to the Thursday of this week
  const year = d.getUTCFullYear();           // that Thursday's year is the ISO year
  const week = Math.ceil(((d - Date.UTC(year, 0, 1)) / 86400000 + 1) / 7);
  return { year, week, day };
}

Python

from datetime import date
date(2027, 1, 1).isocalendar()
# IsoCalendarDate(year=2026, week=53, weekday=5)

SQL

-- PostgreSQL: the week field is the ISO week; isoyear is the ISO week-year
SELECT EXTRACT(WEEK FROM DATE '2027-01-01'),    -- 53
       EXTRACT(ISOYEAR FROM DATE '2027-01-01'); -- 2026

-- MySQL: mode 3 is the ISO definition
SELECT WEEK('2027-01-01', 3);                   -- 53

In every language, the trick is the same as in rule 3: find the Thursday of the date’s Monday-to-Sunday week. Its year is the ISO week-year, and counting the weeks from that year’s first Thursday gives the week number.

Sources

  1. ISO 8601 — Date and time format (ISO)
  2. ISOWEEKNUM function (Microsoft Support)
  3. PostgreSQL: Date/Time Functions and Operators
  4. MySQL 8.4: Date and Time Functions

Dates, offsets and astronomical times quoted here are computed with the same code that powers the site's tools — see data sources and methods. Found an error? Tell us.

More related articles