Staaarter

Find Week of the Year

Calculates the real ISO 8601 week number for a calendar date, using the standard's Monday-start weeks and the first-Thursday rule for week 1, including the correct handling of dates near a year boundary that belong to the adjacent ISO year. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-05
By Staaarter Team
date-calculationcalendar

Overview

Introduction

"What week of the year is it?" has more than one possible answer depending on which convention is used. The ISO 8601 standard defines a precise, unambiguous version used widely in business, engineering, and software systems.

This tool implements that exact standard rather than approximating it, including its Monday-start weeks and its rule for assigning week 1.

What Is Find Week of the Year?

An ISO 8601 week number finder that returns a date's week in the format YYYY-Www, where YYYY is the ISO week-numbering year and ww is a zero-padded week number from 01 to 53.

Week 1 of any ISO year is defined as the week, Monday through Sunday, that contains that year's first Thursday, which is equivalent to saying it's the week containing January 4th.

How Find Week of the Year Works

The entered date is shifted to the Thursday of its own Monday-to-Sunday week, since a week's ISO year and week number are both defined by that Thursday.

The tool then measures how many whole weeks separate that Thursday from January 1 of its year, giving the final week number, and reports the Thursday's year as the ISO week-numbering year, which can differ from the entered date's calendar year near January or December.

When To Use Find Week of the Year

Use it for sprint planning, invoicing, manufacturing, or any workflow that references "week 23" or similar ISO week labels rather than calendar dates.

It's also useful for verifying a spreadsheet or reporting tool's week number output, since many default to non-ISO, Sunday-start week conventions that disagree with ISO 8601 near year boundaries.

Features

Advantages

  • Implements the real ISO 8601 algorithm precisely, not a day-of-year-divided-by-seven approximation that gets the boundary weeks wrong.
  • Correctly reports the ISO week-numbering year for dates that belong to a different ISO year than their calendar year.

Limitations

  • Only computes the ISO 8601 convention; it does not offer the alternative Sunday-start or "week containing January 1st is always week 1" conventions some other systems use.
  • Accepts one date per run in strict YYYY-MM-DD format.

Examples

New Year's Day that starts ISO week 1

Input

2026-01-01

Output

2026-W01

January 1, 2026 is a Thursday, so it falls in the week containing the year's first Thursday, which is ISO week 1 of 2026.

A January date that belongs to the previous ISO year

Input

2027-01-01

Output

2026-W53

January 1, 2027 is a Friday, so its Monday-to-Sunday week's Thursday falls on December 31, 2026, placing the date in week 53 of the 2026 ISO year rather than week 1 of 2027.

Best Practices & Notes

Best Practices

  • Treat the ISO year in the output, not the calendar year of the input date, as the correct year label whenever the two differ.
  • When comparing against another tool's week number, confirm it's using the ISO 8601 Monday-start convention before assuming a mismatch is a bug.

Developer Notes

The implementation follows the standard JavaScript ISO week recipe: shift the target date to its own week's Thursday via `date.setUTCDate(date.getUTCDate() + 4 - (date.getUTCDay() || 7))` (mapping Sunday's `getUTCDay()` value of 0 to 7 so Monday-start weeks compute correctly), then divide the whole-day distance from that Thursday's January 1st by 7 and round up. All arithmetic runs in UTC to avoid local time zone drift near midnight.

Find Week of the Year Use Cases

  • Reporting sprint or fiscal week numbers that follow ISO 8601 in project management tools
  • Cross-checking a spreadsheet's WEEKNUM output against the real ISO 8601 standard
  • Labeling manufacturing batches or invoices with an ISO week code

Common Mistakes

  • Assuming week 1 always starts on January 1st, when it actually starts on the Monday of the week containing the year's first Thursday, which can be a few days into January or a few days before it.
  • Using a naive day-of-year divided by 7 formula, which misassigns the first and last week of most years.

Tips

  • If a date's week number surprises you, check whether it's a late-December or early-January date, that's where the ISO year and calendar year most often diverge.
  • Pair with Find Day of the Year when a workflow needs both the ordinal day and the ISO week for the same date.

References

Frequently Asked Questions