ISO Week Number Calculator

This calculator converts a date to its week number and back again. In ISO 8601 mode it returns the week number, the week-based year — which is not always the calendar year — and the Monday-to-Sunday date range of that week, plus whether the year holds 52 or 53 weeks. Switch to the US Sunday-start or the simple 1–7 January system if your organisation uses one of those instead. Manufacturing schedules, European delivery dates and payroll periods are almost always quoted in ISO weeks, and the difference between the conventions is a full week at the turn of the year.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
What do you want to convert?Choose the direction; the fields you do not need are hidden.Date → week number
Week numbering systemISO 8601 is the standard used across Europe and in most manufacturing systems.ISO 8601 — Monday start, week 1 holds the first Thursday
YearCalendar year of the date, or the week-based year when converting a week number.2026
MonthMonth number, 1 for January through 12 for December.8
Day of monthDay of the month; a day beyond the month's length is clamped and flagged.2
Week numberThe week whose date range you want; 53 exists only in some years.31

It returns

  • Week number — The week of the year under the numbering system you selected.
  • Week-based year — In ISO 8601 this can differ from the calendar year at the start and end of January.
  • First day of the week
  • Last day of the week
  • Weeks in that year
  • Day of the year

The formula

W=nw+107
JDNMon=JDN(Jan 4)(w1)+7(W1)

In plain text: W = ⌊(ordinal day − ISO weekday + 10) / 7⌋, where W = 0 means the last week of the previous year

  • WISO week number; 0 rolls back to the last week of the previous year, and 53 rolls forward to week 1 of the next when the year holds only 52 (1–53)
  • nOrdinal day of the year, 1 for 1 January (1–366)
  • wISO weekday of the date: Monday 1 … Sunday 7 (1–7)

The +10 is 7 + 3: seven to shift the floor division onto week boundaries, and three because a week is assigned to the year containing its Thursday, the fourth day.

Updated Category Date Math & Business Calendars Verified against published test cases Reading time 11 min

What an ISO week number is, and why it has its own year

An ISO week is a Monday-to-Sunday block of exactly seven days, and every week belongs entirely to one year — the year that contains its Thursday. That single rule generates everything else in the standard. Because a week is never split across a year boundary, the first week of a year can begin as early as 29 December and the last can end as late as 3 January, and a date in early January can legitimately carry the previous year's week number.

That is why ISO 8601 defines a separate week-based year. Friday 1 January 2021 belongs to week 53 of 2020, so its full ISO week date is 2020-W53-5. Writing it as week 53 of 2021 is wrong, and it is wrong by a full week in a production schedule. Any system that quotes a week number without also quoting the week-based year is ambiguous for about six days each January.

The rule also determines how many weeks a year has. A year has 53 ISO weeks when 1 January falls on a Thursday, or when a leap year begins on a Wednesday — in either case a 53rd Thursday exists inside the calendar year. Every other year has 52. Across a full 400-year Gregorian cycle there are 71 long years and 329 short ones, so a 53-week year comes round roughly every five or six years.

Week numbering matters most in manufacturing, logistics and European business. Component date codes are stamped with a two-digit year and a two-digit week. Delivery schedules are quoted "week 34". German, Nordic and Dutch offices plan by Kalenderwoche or vecka almost exclusively. Payroll and shift rotas run on weeks because a week is the only period with a fixed length.

The formula, and where the +10 comes from

The one-line calculation is W = ⌊(n − w + 10) / 7⌋, where n is the ordinal day of the year and w is the ISO weekday, Monday 1 through Sunday 7. It is worth understanding the constant rather than memorising it.

Start with n − w. That is the ordinal day of the Sunday before the week containing your date — subtracting the weekday index walks you back to the day before Monday. Add 3 and you land on the Thursday of your week, expressed as an ordinal day that can be zero or negative if the Thursday belongs to the previous year. Now you want to know which week that Thursday sits in, counting from the year start: divide by 7 and take the floor, adding 7 first so the count starts at 1 rather than 0. Three plus seven is the ten.

The result needs two corrections. If W comes out as 0, your week's Thursday belongs to the previous calendar year, so the date sits in that year's final week — 52 or 53, depending on that year. If W comes out as 53 in a year that only holds 52 weeks, your week's Thursday has fallen into the next year, so the date is in week 1 of the following week-based year.

The inverse direction is simpler because 4 January is always in week 1 — it is the earliest date that is guaranteed to be, since week 1 must contain the first Thursday and 4 January is at most three days after it. So the Monday of week 1 is 4 January minus its weekday offset, and the Monday of week W is that plus 7(W − 1).

The two alternative systems in the selector are not standards, they are conventions. The Sunday-start or broadcast system says week 1 is whichever week contains 1 January, with weeks starting on Sunday, so week 1 is often only a few days long in practice and 1 January is always in week 1. The simple system just chops the year into blocks of seven from 1 January, which makes week 53 either one or two days long. Both are easier to explain and neither round-trips cleanly across a year boundary.

Worked example: which ISO week is 2 August 2026?

Work it in three steps with no calendar in front of you.

  1. Ordinal day. 2026 is not a leap year, so the cumulative month ends are 31, 59, 90, 120, 151, 181, 212 for January through July. 2 August is therefore day 212 + 2 = 214.
  2. ISO weekday. 1 January 2026 is a Thursday, ISO weekday 4. Day 214 is 213 days later, and 213 mod 7 = 3 (since 7 × 30 = 210). Thursday plus three days is Sunday, ISO weekday 7.
  3. Apply the formula. W = ⌊(214 − 7 + 10) / 7⌋ = ⌊217 / 7⌋ = 31. Since 2026 has 53 weeks and 31 is between 1 and 53, no correction is needed, and the week-based year is 2026.
  4. Date range. The date is the Sunday of its week, so the week began six days earlier, on Monday 27 July 2026, and ended on 2 August. The ISO week date is 2026-W31-7.

Now the awkward one. For 1 January 2021: the ordinal day is 1, and 1 January 2021 was a Friday, so w = 5. W = ⌊(1 − 5 + 10) / 7⌋ = ⌊6 / 7⌋ = 0. A zero means roll back. How many weeks did 2020 have? 1 January 2020 was a Wednesday and 2020 was a leap year, which is one of the two long-year conditions, so 2020 had 53 weeks. The answer is therefore week 53 of 2020, running Monday 28 December 2020 to Sunday 3 January 2021.

Check that against 2026 for contrast: 1 January 2026 is a Thursday, giving W = ⌊(1 − 4 + 10)/7⌋ = ⌊7/7⌋ = 1. A Thursday 1 January is always in week 1, which is exactly the rule that makes the year 53 weeks long.

Reading a week number safely

Always carry the week-based year with the week number. "W01" without a year is ambiguous at exactly the moment it matters most, the turn of the year, and the ambiguity is a whole week of production. The ISO week date format is 2026-W31-7: year, W, two-digit week, and optionally the weekday. Written that way it cannot be misread.

Check whether your software agrees with the standard. Spreadsheet week functions are a common source of mismatch: the plain WEEKNUM function in Excel and Google Sheets defaults to the Sunday-start convention, not ISO, and returns 1 for 1 January 2021 where the standard returns 53. ISOWEEKNUM gives the standard answer. Python's date.isocalendar(), PostgreSQL's EXTRACT(WEEK …) and Java's WeekFields.ISO all follow ISO 8601.

Watch for the 53-week year in anything that assumes 52. Annual budgets built on 52 weekly periods are short by one period in a long year, which is why retail and manufacturing calendars using 4-4-5 quarters insert a 53rd week roughly every five or six years and explicitly plan for it. If your comparison of like-for-like weekly sales is year-on-year, a 53-week year shifts every subsequent week by one against the previous year.

Finally, remember that the week number tells you nothing about the month. Week 31 of 2026 spans 27 July to 2 August, straddling two months. Any process that maps weeks to months has to choose a rule — most commonly the month containing the week's Thursday, which is the same tie-break ISO uses for years.

Which recent and coming years hold 53 ISO weeks

A year has 53 ISO weeks when 1 January is a Thursday, or when the year is a leap year beginning on a Wednesday. Every other year has 52.
YearWeekday of 1 JanuaryLeap year?ISO weeks
2020WednesdayYes53
2021FridayNo52
2022SaturdayNo52
2023SundayNo52
2024MondayYes52
2025WednesdayNo52
2026ThursdayNo53
2027FridayNo52
2028SaturdayYes52
2032ThursdayYes53
2037ThursdayNo53

Note 2024: a leap year starting on Monday still has only 52 weeks, because the long-year condition needs a Wednesday start. The leap-year rule alone does not make a year long.

Traps in week numbering

  • Quoting a week number with the calendar year instead of the week-based year. For about six days each January the two differ, and a schedule slips by a week.
  • Assuming Excel's WEEKNUM is ISO. It is not, by default. Use ISOWEEKNUM, or WEEKNUM with the return-type argument 21.
  • Building an annual plan on 52 weeks. Roughly every five or six years the ISO year is 53 weeks long, and the extra week has to go somewhere.
  • Assuming a leap year has 53 weeks. 2024 was a leap year with 52 ISO weeks. The condition is about which weekday the year starts on, not about its length alone.
  • Mapping weeks to months by their first day. A week that starts on 30 July and ends on 5 August belongs to neither month cleanly. Pick a rule — the Thursday rule is the consistent one — and document it.
  • Mixing systems between two departments. A supplier using the Sunday-start convention and a customer using ISO will disagree by one on many dates. Check which system a date code uses before you read a week off it with the day of the week calculator.

Related standards and tools

ISO 8601 defines much more than week numbers: it is also the source of the YYYY-MM-DD date format, the 24-hour hh:mm:ss time format, the T separator and the Z suffix for UTC. The current edition is ISO 8601-1:2019, which split the standard into a basic part and an extensions part. Anything you exchange between systems should use it, because it is the only widely-supported format that sorts correctly as plain text.

To move between the pieces: the day of the week calculator gives you the ISO weekday number that this formula needs; the leap year calculator settles the leap condition in the 53-week test; and the age in days calculator converts a span of weeks to an exact day count. If you are handling week numbers in code, the Unix timestamp converter is usually the layer underneath — most libraries derive the ISO week from an epoch value.

One historical footnote. Week numbering was standardised largely because European industry was already using it informally and inconsistently. ISO 2015 in 1976 was the first international text to fix the Monday start and the first-Thursday rule; it was folded into ISO 8601 in 1988. The Monday start is also why the standard defines Sunday as day 7 rather than day 1, which remains the most frequent single point of confusion when moving data between an American and a European system.

Frequently asked questions

What week number is it right now?

Enter today's date above with ISO 8601 selected and read the week number and week-based year together. Do not quote one without the other: for the first days of January the week-based year is often the previous calendar year, because ISO assigns a whole week to the year containing its Thursday.

How many weeks are in a year?

Fifty-two in most years and fifty-three in a long year. A year has 53 ISO weeks when 1 January falls on a Thursday, or when it is a leap year starting on a Wednesday. Over a full 400-year Gregorian cycle, 71 of the 400 years are long. Recent and coming long years include 2020, 2026, 2032 and 2037.

Why does 1 January sometimes fall in week 52 or 53 of the previous year?

Because ISO weeks never split across years. A week belongs entirely to the year that contains its Thursday, so if 1 January falls on a Friday, Saturday or Sunday, its week's Thursday was in December and the whole week — including 1 January — carries the previous year's number. Friday 1 January 2021 is 2020-W53-5.

Does the ISO week start on Monday or Sunday?

Monday. ISO 8601 defines Monday as day 1 and Sunday as day 7 of the week. The Sunday-start convention is common in the United States and in broadcast scheduling, and it is offered above as a separate option, but it is not what "ISO week" means and the two disagree on many dates.

How do I convert a week number back to a date?

Switch the mode above to "week number → date range" and enter the week-based year and week. By hand: find the Monday of week 1, which is 4 January minus its ISO weekday offset, then add 7 × (W − 1) days. Four January is used because it is the earliest date guaranteed to fall in week 1.

Why does Excel give me a different week number?

Because the plain WEEKNUM function defaults to the Sunday-start convention, where week 1 is simply the week containing 1 January. Use ISOWEEKNUM instead, or WEEKNUM with return type 21. The two functions disagree by one for many dates and by a full year's numbering in early January.

What does a date code like 2634 on a component mean?

Almost always year and week: manufactured in week 34 of 2026. Four-digit codes are usually YYWW, and some manufacturers use YWW with a single year digit. Enter 2026 and week 34 in "week number → date range" mode above to get the actual manufacturing dates. Check the manufacturer's datasheet, because a few use a Julian day-of-year code instead.

Can a week number be 0?

Not in a valid ISO week date. Week 0 appears only as an intermediate result of the formula, and it means the date belongs to the last week of the previous week-based year. If a system reports week 0 to you, it has skipped the roll-back correction and the week number should be 52 or 53 of the year before.

References