Last weekday of the month
Pick a year, a month and a weekday to get the date of its last occurrence: the last Friday of July 2026 is 2026-07-31. Leap-year Februaries are handled, and the steps are listed so you can check them. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Year
- 2,026
- Month
- 7
- Target weekday: English name
- Friday
- Date
- 2026-07-31
- Day
- 31
- Month name
- July
- Day name
- Friday
A last weekday of the month calculator answers a planning question people ask constantly: when is the last Friday of July, the final Monday of February, or the closing Sunday of December? Enter a Gregorian year, a month from one through twelve, and a weekday as an English name or an ISO number from one through seven, and this tool returns the exact calendar date of that last occurrence, plus weekday labels, the ISO weekday number, days in the month, and a short step list you can audit.
What “last weekday of the month” means on the Gregorian calendar
Every civil month has a last calendar day—the twenty-eighth, twenty-ninth, thirtieth, or thirty-first—depending on the month and, for February, on whether the year is a Gregorian leap year. The last Monday, last Tuesday, or last Friday of that month is simply the latest day number in the month whose weekday matches the one you asked for. If the final calendar day already falls on the target weekday, that day is the answer; otherwise you step back at most six days until the names line up.
Leap years matter only for February: years divisible by four are leap years unless they are century years not divisible by four hundred, so February can have twenty-nine days and the last weekday can land on the twenty-ninth. Weekday numbering in the response follows the ISO convention used across many business systems: Monday is one, Tuesday is two, continuing through Sunday as seven. That is different from libraries that treat Sunday as zero, which is why the response also exposes a Sunday-origin index for callers that need it.
Practical tips, limits, and related searches
Prefer full English weekday names when humans type into a form, and ISO numbers one through seven when another system already stores Monday-first week indices. Always send month as a number from one to twelve; zero-based months from some programming languages will be rejected, which is intentional so silent off-by-one bugs do not ship a wrong end-of-month date.
Round-trip checks are easy: take the returned ISO date, run it through a day-of-week calculator, and confirm the weekday name matches and that no later day in the same month shares that name. Year bounds stop at nine thousand nine hundred ninety-nine to keep four-digit ISO strings well defined for this product surface.
This landing targets people searching for the last weekday of the month, last Friday of the month, or final Monday date online; it is not a first-weekday finder, not a business-day counter, and not a full date-difference or age tool. Prefer this capability when you already know year, month, and weekday and only need the closing occurrence; if you already have a full ISO date and only need its weekday name, use the day-of-the-week calculator instead.
What you can do with it
End-of-month meeting and payroll dates
Operations teams resolve “last Friday of the month” or “last Monday of March” into a concrete ISO date for calendars, cutoffs, and reminder jobs.
Classroom calendar exercises
Students check hand-written last-weekday answers against a fixed Gregorian result, including leap-year February edge cases.
FAQ
What does last weekday of the month mean?
It is the latest calendar day in that month that falls on the weekday you specify—for example, the last Friday of July is the Friday closest to the end of July without leaving the month.
What happens if month is outside 1–12?
Only months from 1 (January) through 12 (December) are accepted.
Does February handle leap years?
Yes. Gregorian leap rules apply, so February can have 29 days and the last weekday can land on the 29th only in leap years.
Is the last weekday of the month calculator free?
The browser tool is free and runs locally.
Is this the same as the last working day of the month?
No. It finds the last date that carries the weekday you pick, such as the final Friday. It does not skip bank holidays or apply local last-working-day rules, so check those separately.
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/last-weekday-of-month \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"year":2026,"month":7,"weekday":"Friday"}'const res = await fetch("https://api.kit.forhosting.com/date/last-weekday-of-month", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"year": 2026,
"month": 7,
"weekday": "Friday"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/last-weekday-of-month",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"year": 2026,
"month": 7,
"weekday": "Friday"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/last-weekday-of-month", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"year":2026,"month":7,"weekday":"Friday"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"year":2026,"month":7,"weekday":"Friday"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/last-weekday-of-month", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"year": 2026,
"month": 7,
"weekday": "Friday"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.last_weekday_of_month",
"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.
Limits
year_min | 1 |
year_max | 9999 |
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
Impossible months outside one to twelve, unknown weekday tokens, and out-of-range years are rejected with a clear invalid_input error instead of a silent wrong day.
What “last weekday of the month” means on the Gregorian calendar
Because the computation never calls the host clock, a request for July twenty twenty-six always yields the same last Friday whether you run it in Tokyo, New York, or on a Worker at the edge. This capability is about one month and one weekday name—not about business-day calendars, bank holidays, or “last working day” policies that skip weekends by local rule.
How to call the API and what comes back
Send a JSON body with three required fields: year as an integer from one through nine thousand nine hundred ninety-nine, month as an integer from one through twelve, and weekday as an English long or short name such as Friday or Fri, or as an ISO weekday number from one through seven where Monday is one and Sunday is seven. Aliases exist for convenience: y for year, m for month, and day, dow, or day_of_week for weekday. On success the response sets date to the canonical ISO calendar string, echoes year, month, and day as numbers, sets month_name and day_name to English labels, day_name_short to a three-letter form, iso_weekday and day_of_week to the same ISO integer, weekday_0_sunday to the zero-through-six index, days_in_month to the length of that month, leap_year to a boolean for the year, and includes a short message plus an ordered steps array that restates the leap check, the weekday of the last calendar day, the offset, and the final date. Failed validation—missing fields, non-integer year or month, month outside one to twelve, unrecognised weekday tokens, or year outside the published range—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
When teaching or testing, keep a small known set: a long month such as July with a Friday target, a leap February with a weekday that can fall on the twenty-ninth, a short thirty-day month, and a deliberate failure with month thirteen to prove the hard invalid_input path. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when callers deliberately send out-of-range months.
Integration use cases
Scheduler and UI fixture generation
Engineers build deterministic end-of-month weekday fixtures for unit tests without depending on the host clock or timezone.
Technical questions
Which weekday formats are accepted?
English names (Monday…Sunday or Mon…Sun) and ISO numbers 1–7 (Monday=1 … Sunday=7). Unrecognised tokens return invalid_input.