ISO Week Date Converter
ISO 8601 numbers weeks by the year of their Thursday, which means 1 January can belong to week 52 or 53 of the year before, and 31 December can belong to week 1 of the year after. Almost every hand-rolled week-number function gets this wrong, and the failure is invisible until somebody's report lands in the wrong year. This converts a date both ways and shows the ISO year explicitly, so a mismatch is visible rather than surprising.
What this generator does
Answers the week-number question exactly, including the part everybody gets wrong. The date tools elsewhere on this site produce or format dates; this one converts between a calendar date and the ISO 8601 week date, and it is explicit about the ISO year — the field that makes the whole thing correct and that most implementations quietly drop.
How to use this tool
- Enter a date as YYYY-MM-DD.
- Read the ISO week date — year, week and weekday.
- Check the note if the ISO year differs from the calendar year.
- Use the second field to find out whether a year has 52 or 53 weeks.
Understanding the controls
- Date
- Any date as YYYY-MM-DD. Try 1 January or 31 December of any year — those are where the ISO year and the calendar year part company.
- Year to check
- Reports whether that year has 52 or 53 ISO weeks, whether it is a leap year, and how many days February has. A fixed 52-element array overflows in a 53-week year.
Worked examples
- 2021-01-01
- 2020-W53-5 — a Friday in the last week of 2020.
- 2019-12-31
- 2020-W01-2 — a Tuesday in the first week of 2020.
- 2020
- 53 ISO weeks. 2021 has 52.
- The round trip
- Every date converts to a week date and back to itself.
Common use cases
- Checking a week number before using it in a report or a filename
- Debugging a week-based aggregation that is off by a year at the boundary
- Finding out which years have 53 ISO weeks before sizing a fixed array
- Confirming a supplier's or a client's week numbering matches yours
- Explaining to somebody why 1 January is in last year's week 53
How this generator works
The ISO year is derived from the Thursday of the date's week rather than special-cased at the January boundary, which is what makes both awkward cases fall out automatically. The conversion is checked against its own inverse: converting a date to a week date and back returns the same date, and the tests drive that over every day of a twelve-year span including the 53-week years.
Randomness and fairness
Nothing here is random. It is a conversion: the same date always gives the same week date, and the inverse always returns the original.
For how randomness is produced across the whole site, see how Generate Random works.
Assumptions this tool makes
- Weeks begin on Monday and the first ISO week of a year is the one containing its first Thursday.
Limitations and good to know
- This is ISO 8601 week numbering only. US and Middle Eastern conventions start the week on a Sunday or a Saturday and number the first week differently; those are not implemented.
- It converts single dates rather than ranges.
- There is no time-of-day or timezone handling.
Common mistakes
- Pairing an ISO week number with the calendar year
- Use the ISO year the tool shows. Combining week 53 with the wrong year lands you up to a year out, and it only breaks at the boundary — which is why it reaches production.
- Assuming every year has 52 weeks
- Roughly one year in six has 53. A fixed-size array or a hardcoded loop bound will overflow in those.
Practical tips
- When storing a week, store the ISO year with it — never the calendar year.
- Check both 1 January and 31 December of any year you are about to process.
Privacy and your data
The dates you type stay in your browser. Nothing is uploaded, nothing is stored, and nothing is written into the page address. Analytics records only that the tool was used.
Frequently asked questions
- Why is 1 January 2021 in week 53 of 2020?
- Because ISO 8601 assigns a week to the year containing its Thursday. That week's Thursday was 31 December 2020, so the whole week — including 1 January — belongs to 2020.
- Which years have 53 weeks?
- Years that start on a Thursday, and leap years that start on a Wednesday. Rather than memorising that, enter the year and the tool will tell you.
- Does this work for US week numbers?
- No. This is ISO 8601, where weeks start on Monday. US conventions start on Sunday and number the first week differently, and mixing the two is its own class of bug.
Related generators
- Date Edge Case GeneratorThe dates that break software — leap days, month ends, clock changes, ISO week boundaries — as real test data.
- Business Day CalculatorWorking days between two dates, and the date a number of working days away — with both ends counted and holidays excluded.
- Timestamp Sequence GeneratorGenerate an ordered run of timestamps at a set interval, with optional jitter, in ISO, epoch, SQL or date-only format.