416 Range Not Satisfiable
The byte range asked for in the Range header is outside the file, so the server cannot send that part.
What 416 Range Not Satisfiable means
Older specs called this Requested Range Not Satisfiable. It happens when a client asks for bytes past the end of the resource, such as bytes=5000- on a 4000-byte file.
The server should send Content-Range: bytes */4000 so the client learns the real size.
Common causes
- Resuming a download after the file on the server changed or got smaller.
- A client bug that calculates the wrong offsets.
- A partial download in a local cache that no longer matches the server's file.
How to fix 416 Range Not Satisfiable
- Restart the download from the beginning, or delete the partial file.
- Send If-Range with the ETag so the server returns the full file when it has changed.
- Read the Content-Range header in the 416 response to get the actual size.
Headers that go with it
RangeContent-RangeIf-Range
Example response
HTTP/1.1 416 Range Not Satisfiable
Content-Range: bytes 0-1023/4096
Content-Type: text/plain; charset=utf-8
416 Range Not SatisfiableHow to check for a 416 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 416) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 416:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 416 {
fmt.Println(res.Status)
}Specification
416 Range Not Satisfiable is defined in RFC 9110, section 15.5.17.
Related status codes
- 206
The server is sending only part of the file: the byte range the client asked for in its Range header.
- 200
The request worked. The response body holds the result, such as the page, file or JSON data the client asked for.
- 412
A condition in the request headers, such as If-Match or If-Unmodified-Since, was false, so the server did not apply the request.