Week number with custom first day
Pick the day your weeks start on and get the week number of any date, with week 1 always holding 1 January: 15 March 2024 is in week 11 when weeks start on Monday. Sunday, Saturday or any other start day works too. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2024-03-15
- First weekday
- monday
- Year
- 2,024
- Month
- 3
- Day
- 15
- Day of year
- 75
This week number calculator takes a single Gregorian calendar date in YYYY-MM-DD form and a caller-chosen first weekday, then returns the week-of-year number under a simple, explicit rule: weeks always start on the day you pick, and week 1 is the week that contains 1 January of the civil year. That convention matches common spreadsheet and operations practice when you need Sunday, Monday, Saturday, or any other start day without adopting full ISO-8601 week-year boundaries. The engine uses only deterministic integer calendar arithmetic—leap years, month lengths, day-of-year, and Sakamoto weekdays—with no network calls, random sampling, or host clock.
What a custom week number is and what you get
A week-of-year number answers “which week of this civil year does this date fall in?” once you fix how weeks begin. Unlike the ISO-8601 week date, which always starts on Monday and may assign late December or early January to a different week-year, this calculator keeps the civil year fixed and only changes the start weekday.
If you need ISO week and week-year pairs, use the dedicated ISO week number tool; if you only need Sunday-start US weeks, the US week number tool is a fixed specialization of the same family. This page is for teams that deliberately pick the first day of the week and still want a stable week index inside the civil year.
Where custom-start week numbers fit in planning, reporting, and software
Operations and product teams often need a weekly cadence that matches local culture: many European boards start on Monday, US retail and some school calendars start on Sunday, and some industries treat Saturday as the first day for shift rotas. A single calculator that only changes the start weekday while keeping week 1 pinned to the week of 1 January lets the same codebase serve those audiences without shipping seven slightly different week helpers.
Developers stamp log buckets, sprint labels, and timesheet periods with a deterministic index that matches spreadsheet WEEKNUM-style expectations when the return type is generalized beyond Sunday. Educators and standards writers can demonstrate side-by-side that Monday-start week numbers under the January-1 rule are not the same as ISO week numbers near year boundaries, which prevents costly off-by-one bugs in compliance worksheets.
Pair it with week start and end tools when you need the Monday or Sunday bounds of the same week, with ISO week number when statutory reporting demands ISO-8601, and with day-of-week helpers when you only need the weekday name without a week index.
What you can do with it
Locale-aware weekly dashboards
Stamp reports with week-of-year labels that match regional first-day settings (Monday, Sunday, or Saturday) without switching ISO week-year rules.
Spreadsheet-compatible week indexes
Mirror Excel-style WEEKNUM behavior generalized to any start weekday for imports, timesheets, and finance packs that stay in the civil year.
FAQ
What does the custom first-day week number calculator cost?
It is free in your browser on this page.
How is week 1 defined?
Week 1 is the week that contains 1 January of the civil year. Weeks always run seven days starting on the weekday you choose. This is not the ISO first-Thursday rule.
How is this different from the ISO week number calculator?
ISO weeks always start on Monday and may assign a different week-year near 1 January. This tool keeps the civil year and only changes the first weekday; week 1 always includes January 1.
Does this use time zones or the current clock?
No. It only maps a validated calendar date and first weekday to week fields with pure arithmetic.
Which start day is used if I don't choose one?
Monday. You can switch to any day from Sunday to Saturday, and week 1 stays the week that contains 1 January whichever start day you pick.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/date/week-number-custom-start \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2024-03-15"}'const res = await fetch("https://api.kit.forhosting.com/date/week-number-custom-start", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-03-15"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/week-number-custom-start",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2024-03-15"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/week-number-custom-start", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2024-03-15"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2024-03-15"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/week-number-custom-start", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"date": "2024-03-15"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.week_number_custom_start",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Use it free in the browser for planning boards and locale-specific schedules, or call the API at $0.002 per successful request when pipelines need the same week label every time.
What a custom-start week number is and what the response contains
You pass date as a strict YYYY-MM-DD string and optional first_weekday as an English name (sunday through saturday) or an integer from zero for Sunday through six for Saturday; when first_weekday is omitted, Monday is assumed. After validation the response echoes the normalized date, civil year, month, and day, the day_of_year ordinal, the weekday of the input as both a lowercase name and a Title Case name plus a zero-based index, the resolved first_weekday and first_weekday_index, how many days the date sits from the start of its week, the week_number from one upward, weeks_in_year as the week number of 31 December under the same start day, a week_1_rule of contains_january_1, leap-year and calendar flags, a method tag, and a short formula string for documentation. There is no timezone conversion and no dependency on “today”: either the inputs form a real calendar day and a legal first weekday, or the request fails with invalid_input. Rejected cases include a missing date, shapes such as 2024/03/15, impossible months, non-leap 29 February, and unknown weekday tokens.
How the date and first weekday are read so results stay reproducible
The string must match four digits, a hyphen, two digits, another hyphen, and two digits; leading or trailing spaces are trimmed, but partial dates, month names, and ordinal day-of-year alone are not expanded here. The year must fall between 1 and 9999, the month between 1 and 12, and the day between 1 and the true length of that month in that year, with leap years following the Gregorian rule of divisible by four except century years not divisible by four hundred. The preferred date field is date, but aliases iso_date, d, value, and calendar are accepted so spreadsheets, query strings, and typed forms can reuse the contract without renaming columns. The first_weekday field accepts names or numeric indices and has aliases week_start, start_day, and first_day; empty or omitted values default to Monday so ISO-style week starts remain one keystroke away without forcing the ISO week-year rule. From the validated triple the engine computes day_of_year by summing month lengths with a February leap adjustment, then weekdays of both the input date and 1 January via Sakamoto’s pure-integer method mapped so Sunday is zero and Saturday is six. The offset of January 1 inside the custom week is (weekday of January 1 minus first_weekday plus seven) modulo seven; the week number is the floor of day_of_year minus one plus that offset, all divided by seven, then plus one. The week number of 31 December under the same start day is returned as weeks_in_year so dashboards can know whether a year runs to 52, 53, or 54 week labels for that configuration. Pair the free browser run on this page with the priced API when you need the identical week label inside an automated pipeline.
Where custom-start week numbers fit in planning, reporting, and software
Analysts building year-over-year dashboards can store week_number together with first_weekday_index so filters remain unambiguous when two regions disagree about when the week begins. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a one-off check to a pipeline without changing the mathematical result.
Integration use cases
Deterministic CI fixtures
Generate reproducible week_number values for unit tests under several first_weekday settings without Date skew or host locale.
Technical questions
What values can first_weekday take?
English names sunday through saturday (case-insensitive), or integers 0–6 with Sunday = 0 and Saturday = 6. The default is monday when the field is omitted.