HTTP Range header calculator
Check a byte range before you send it: 0-499 on a 10000-byte file means the first 500 bytes, a satisfiable range that earns 206 Partial Content and the line bytes 0-499/10000. Open-ended and last-bytes forms work too. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Calculation mode
- Parse
- Range header
- bytes=0-499
- Resource size
- 10,000
- Range count
- 1 bytes
- Status hint
- 206
- Bytes requested
- 500
- Content range
- bytes 0-499/10000
Writing bytes=start-end by hand is easy until you need suffix form, open ends, multipartite sets, or a Content-Range line that matches a real file size. Failed validation is not billed.
Three ways to ask for part of a file
A Range header tells a server which bytes of a file you want instead of the whole thing. The closed form gives a start and an end, both included, so 0-499 is the first 500 bytes. The open form gives only a start, such as 500-, and runs to the last byte, which is how an interrupted download resumes exactly where it stopped. The suffix form, such as -500, asks for the last 500 bytes when you know how much is left but not the offset. You can combine up to 32 of these in one header, separated by commas.
Checking a range against the real file size
Give the file size and every range is turned into absolute positions: open ends close at the size minus one, suffixes become the trailing window, and a range that starts past the end is marked unsatisfiable. When all ranges fit, the answer to expect is 206 Partial Content; otherwise it is 416 Range Not Satisfiable. For a single range that fits you also get the matching Content-Range line, such as bytes 0-499/10000 for the first 500 bytes of a 10000-byte file. You can paste a full header or build one from a start, an end or a suffix.
What a Range header asks for, and the forms accepted
Per RFC 9110, the common unit is bytes, and the value after the equals sign is a comma-separated set of range specs. An open-ended range start- means from that offset through the last byte of the current representation. A suffix range -N means the last N bytes, which is the form download managers use when they know how much is left but not the absolute offset.
This calculator accepts a full Range line or the bare unit equals ranges form, normalizes the unit to lowercase bytes, strips optional whitespace, and rejects any unit other than bytes. Multipartite sets are allowed up to thirty-two parts so you can express sparse reads without inventing a custom mini-language.
What you can do with it
Resume interrupted downloads
Build or parse bytes=start- ranges against a known file size so a client can resume exactly where the previous transfer stopped without overlapping or gaps.
FAQ
What does a range of 0-499 ask for?
The first 500 bytes. A closed range includes both ends, so 0-499 covers byte 0 through byte 499. Treating the end as excluded would leave out the last byte.
How do I ask for the last part of a file?
Use the suffix form, a minus sign followed by a number, such as -500 for the last 500 bytes. Download managers use it when they know how much is left but not the exact starting offset.
When is a range unsatisfiable?
When it starts past the end of the file. With a file size given, such a range is marked unsatisfiable and the answer to expect is 416 Range Not Satisfiable, together with a Content-Range line that states the real size.
How many ranges can one header hold?
Up to 32, separated by commas, so you can ask for several sparse pieces of a file at once. Only the bytes unit is accepted, and any other unit is rejected.
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/dev/http-range-header \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"parse"}'const res = await fetch("https://api.kit.forhosting.com/dev/http-range-header", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mode": "parse"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/http-range-header",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mode": "parse"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/http-range-header", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mode":"parse"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mode":"parse"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/http-range-header", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mode": "parse"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.http_range_header",
"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
Partial downloads, video seeking, and resume-after-interrupt all depend on the HTTP Range request header. This HTTP Range header calculator accepts either a Range value to parse or discrete start, end, and suffix fields to build one, then returns structured ranges with lengths, optional satisfiability against a resource size, a status hint of 206 or 416, and a Content-Range string when a single satisfiable range is known. Use it when you want deterministic byte arithmetic without standing up a full HTTP stack just to check a header.
What an HTTP Range header means and which forms this tool accepts
An HTTP Range request tells a server which byte intervals of a representation the client wants instead of the whole body. A closed range start-end is inclusive on both ends, so bytes=0-499 asks for the first five hundred bytes. When you supply resource_size, each spec is resolved to absolute start and end offsets: open ends close at size minus one, suffixes become the trailing window, and closed ranges that start past the end of the file are marked unsatisfiable. When every resolved range is satisfiable and the resource is non-empty, status_hint is 206 Partial Content; otherwise it is 416 Range Not Satisfiable with Content-Range bytes star slash size, matching how careful origin servers answer bad resumes.
Input contract, build versus parse, and response fields
Set mode to parse or build. In parse mode, range_header is required and may look like bytes=0-499, Range: bytes=500-, or multipartite bytes=0-0,-1. In build mode provide either suffix_length for the last-N form, or start with an optional inclusive end for closed or open-ended forms; do not mix suffix_length with start or end. resource_size is optional in both modes: omit it when you only need syntactic normalization and closed-range lengths; include it when you need satisfiable flags, bytes_requested against a real file, content_range, and status_hint. Integers must be non-negative safe integers; suffix_length must be at least one. On success the body always includes mode, the canonical range_header, unit bytes, range_count, and a ranges array. Each range object carries kind (closed, open_end, or suffix), the raw spec string, and when known start, end, length, suffix, and satisfiable. Top-level bytes_requested is the sum of resolved lengths when every length is known. content_range is emitted for a single satisfiable range as bytes start-end slash size, or as bytes star slash size when unsatisfiable. Invalid headers, bad modes, and inconsistent field combinations fail with invalid_input and are not billed. Example: parse bytes=0-499 with resource_size ten thousand yields length five hundred, content_range bytes 0-499/10000, and status_hint 206.
Where an HTTP Range calculator earns its keep
Download managers and installers resume large artifacts by replaying Range headers after a network drop; a shared calculator prevents off-by-one bugs that re-download a whole ISO or skip a critical page of a PDF. Media players seeking inside progressive MP4 or audio files construct open-ended or closed ranges and must know whether the origin will answer 206 or 416 before they paint a scrubber. API gateways and CDN configuration tests assert that edge rules forward and clamp ranges correctly against known object sizes without spinning up a full origin. Keep resource_size honest, pin the structured ranges in tests, and you get reproducible resume math for edge workers, CLI tools, and classroom HTTP labs without shipping a complete stack just to count bytes.
Integration use cases
Media seeking and partial reads
Compute closed or open-ended Range headers for video and audio scrubbing, and verify 206 versus 416 before issuing the request to origin or CDN.
Gateway and SDK test fixtures
Generate canonical Range and Content-Range strings in automated tests so edge rules and client libraries agree on multipartite and suffix forms.
Technical questions
What Range forms does the HTTP Range header calculator support?
Unit bytes only: closed start-end, open-ended start-, and suffix -N, including comma-separated multipartite sets up to 32 parts. Other units are rejected.
How do I build a Range for the last N bytes?
Set mode to build and pass suffix_length (for example 500) to emit bytes=-500. Do not send start or end together with suffix_length.
When is status_hint 206 versus 416?
When resource_size is provided and every resolved range is satisfiable on a non-empty resource, status_hint is 206. If the resource is empty or any range starts past the end, it is 416.
Do I need resource_size to parse a header?
No. Without resource_size you still get normalized range_header, kinds, and lengths for closed ranges. Open ends and suffixes need a size to resolve absolute offsets and total bytes_requested.
What does the HTTP Range header calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.