Back to Blog

ISO week numbers — what they are and how to calculate them

May 11, 2026
5 min read
Written by ConvertTime Team
iso-weekcalendarcalculatorbusinessdevelopers

ISO 8601 includes a way to identify weeks of the year as integers 1-53. Used in business (especially European), payroll, and supply chain. Slightly weird because "week 1" might include days from December of the previous year. Here's how it works.

For computing ISO week numbers for any date, the duration calculator helps.

The basic rule

ISO 8601 week numbering:
- Weeks run Monday to Sunday
- Week 1 is the week containing January 4 of the year
- Equivalently: week 1 is the week with the first Thursday in it

This means:
- Some years have 52 weeks
- Some years have 53 weeks
- "Week 1" of one year might include December dates from the previous year
- "Week 52" of one year might include January dates from the next year

Why this rule

The intent: each week belongs to exactly one year. December 31 might be in week 1 of next year if it's a Wednesday-Sunday; week 52 (or 53) of current year if it's a Monday-Tuesday.

The rule based on January 4 ensures:
- The week is mostly in the new year (at least 4 days)
- No ambiguity about which year a week belongs to

Quick examples

2026: January 4 is a Sunday. Week 1 of 2026 starts Monday December 29, 2025. So weeks of 2026 start in December 2025.

2027: January 4 is a Monday. Week 1 of 2027 starts on January 4, 2027.

Long years: years where January 1 is a Thursday or later, with a leap February, can have 53 weeks. 2026 has 53 weeks. 2027 has 52.

The formula for whether a year has 53 weeks: depends on day-of-week of January 1 and whether it's a leap year. Most date libraries calculate this directly.

Reading ISO week dates

ISO 8601 week date format: `YYYY-Www-D`
- `YYYY`: year
- `Www`: week number with 'W' prefix
- `D`: day of week (1 = Monday, 7 = Sunday)

Examples:
- `2026-W01-1` = Monday, December 29, 2025 (yes, "2026" but actually December 2025!)
- `2026-W21-3` = Wednesday, May 20, 2026
- `2027-W01-1` = Monday, January 4, 2027

The year-week format is unusual but unambiguous.

When ISO weeks matter

Business reporting: many companies report financial periods by ISO week. "Q1 covers weeks 1-13" — clear and consistent.

Payroll: weekly payroll often references ISO weeks for consistency.

Supply chain: shipments scheduled by ISO week. "Order will arrive in week 23" — unambiguous.

Project management: agile sprints often align with ISO weeks. Sprint 23 = ISO week 23.

Software: some legacy systems and EU-focused applications use ISO weeks for calendar references.

Calculating ISO week numbers

Most languages have built-in support:

```python

Python


from datetime import date
year, week, day = date(2026, 5, 21).isocalendar()

Returns: (2026, 21, 4) — week 21, Thursday


```

```javascript
// JavaScript (no native ISO week support; use library)
const { getISOWeek, getISOWeekYear } = require('date-fns');
const dt = new Date('2026-05-21');
const week = getISOWeek(dt); // 21
const isoYear = getISOWeekYear(dt); // 2026
```

```sql
-- PostgreSQL
SELECT to_char('2026-05-21'::date, 'IYYY-IW');
-- Returns: '2026-21'

-- Oracle
SELECT tochar(TODATE('2026-05-21', 'YYYY-MM-DD'), 'IYYY-IW') FROM dual;
```

```excel
=ISOWEEKNUM(date)
```

The "year mismatch" issue

ISO week year (the year the week belongs to) sometimes differs from calendar year:

- December 30, 2024: calendar year 2024, ISO week 1 of 2025 (because Dec 30 is in week 1 of 2025)
- January 1, 2026: calendar year 2026, ISO week 53 of 2025 (because Jan 1 falls in last week of 2025)

For consistency:
- Use `ISOWEEKNUM` for ISO week
- Use `ISOWEEKYEAR` (or equivalent) for ISO year
- Don't mix calendar year with ISO week (gives ambiguous results)

Finding the date for a week

Reverse: given week 23 of 2026, what date is Monday?

Most date libraries have inverse functions:

```python
from datetime import date
dt = date.fromisocalendar(2026, 23, 1)

Returns: date(2026, 6, 1) — Monday of week 23, 2026


```

```javascript
import { setISOWeek, setISOWeekYear, startOfISOWeek } from 'date-fns';
const dt = startOfISOWeek(setISOWeek(setISOWeekYear(new Date(), 2026), 23));
```

Comparison with US/UK week numbering

US convention sometimes uses "week 1" as the week containing January 1 (regardless of day-of-week). UK has historically used similar conventions.

ISO 8601 is the international standard. US/UK conventions vary by industry and software.

For cross-region consistency, prefer ISO week numbering.

Special cases

Year 2000 confusion

January 1, 2000 was a Saturday. ISO week 1 of 2000 started December 27, 1999 (Monday). So:
- Friday December 31, 1999: ISO week 52 of 1999 (last week of 1999)
- Saturday January 1, 2000: ISO week 1 of 2000

Some year-end software glitches in 1999-2000 were related to ISO week handling.

Mid-year shifts

Within a year, ISO weeks always increase. There's no "week 27 of year, then back to week 26." Linear progression.

53-week years

Years with 53 weeks happen about every 6 years. The pattern is irregular.

Recent 53-week years: 2009, 2015, 2020, 2026.

Affected industries: payroll, supply chain, financial reporting all have to plan for the extra week. Some payroll systems automatically handle 53-week years; some don't.

Common mistakes

1. Confusing ISO week with calendar week. "Week 1 of 2026" might mean January 1-7 (calendar) or December 29 - January 4 (ISO). Specify which.

2. Using ISO week with wrong year. A date like "2026-W01-1" actually refers to December 29, 2025. The year part is the ISO year, which can differ from calendar year.

3. Spreadsheet inconsistency. Excel's `WEEKNUM(date, 21)` returns ISO week. `WEEKNUM(date)` returns US-style. Different functions.

4. JavaScript no native support. JavaScript Date doesn't have ISO week methods natively. Use a library.

Tools

Web-based:
- The duration calculator — supports ISO week calculation
- timeanddate.com — has ISO week tools
- iso-week-calculator.com

Programming languages:
- Python: `datetime.date.isocalendar()`
- C#: `Calendar.GetWeekOfYear` with `CalendarWeekRule.FirstFourDayWeek`
- Java: `LocalDate.getDayOfWeek` and `WeekFields.ISO`
- Excel: `ISOWEEKNUM(date)`

FAQ

Why does ISO week 1 sometimes start in December?

Because the rule requires the first Thursday of the year to be in week 1. This sometimes pulls the week back to December.

Why does ISO week 53 sometimes appear?

In years where January 1 is a Thursday or later, and the year is a leap year, there's enough room for a 53rd week. Approximately every 6 years.

How can I tell which year a particular ISO week belongs to?

Use the ISO week year, not calendar year. The function `ISOWEEKYEAR` (or equivalent) returns it. They can differ at year boundaries.

Is ISO week the same as "week of the year" in Excel?

Almost. Excel's `WEEKNUM(date, 21)` returns ISO week. Default `WEEKNUM(date)` returns US-style week.

Does ISO week handle leap years differently?

Yes — leap years can have 53 ISO weeks. Non-leap years have 52 (typically) or 53 (rarely).

Is ISO week relevant outside Europe?

Yes. International standards adoption, multinational corporations, and developers working with global systems all use ISO weeks.

Bottom line

ISO week numbering identifies each week of the year as 1-53. Week 1 contains January 4 (or the first Thursday). Some years have 53 weeks. Use ISO week year (not calendar year) when working with ISO week numbers.

For computing ISO weeks and dates between two ISO week dates, the duration calculator helps.

Share this article

Related Articles