416

Range Not Satisfiable

Overview

416 Range Not Satisfiable means the byte range the client requested via the Range header lies outside the actual size of the resource. Asking for bytes at the 100 MB mark of a 5 MB file triggers it.

It commonly appears in resumable downloads or media streaming when the client has a stale idea of the file size. The server responds with Content-Range: bytes */<total> so the client learns the real size.

When it happens

Request / Response example

Request
GET /video.mp4 HTTP/1.1
Host: cdn.example.com
Range: bytes=99999999-100000000
Response
HTTP/1.1 416 Range Not Satisfiable
Content-Range: bytes */5242880
Content-Type: text/plain

Requested range not satisfiable

In code

const size = fs.statSync(file).size;
const m = /bytes=(\d+)-(\d*)/.exec(req.headers.range || '');
const start = m ? Number(m[1]) : 0;
if (start >= size) {
  res.writeHead(416, { 'Content-Range': `bytes */${size}` });
  return res.end();
}
# Ask for the first 1024 bytes; a valid range yields 206, an out-of-bounds one 416
curl -r 0-1023 https://cdn.example.com/video.mp4 -o chunk.bin

Common causes

How to fix

Notes

Related status codes

Related headers

Specification