416

HTTP 416 Range Not Satisfiable

4xx Client Error

4xx Client Error RFC 7233, Section 4.4

What is HTTP 416 Range Not Satisfiable?

The 416 (Range Not Satisfiable) status code indicates that none of the ranges in the request's Range header field overlap the current extent of the selected resource. The response should include a Content-Range header indicating the valid range.

Common Use Cases

  • Requesting a byte range beyond file size
  • Broken resumable download clients

Usage Example

When a video player requests bytes 1000-2000 of a file that is only 500 bytes long, return 416 Range Not Satisfiable with a Content-Range header indicating the file's actual size. The client should restart the download from the beginning or adjust its range.

// PHP - handling invalid range requests
$fileSize = filesize('video.mp4');
$range = $_SERVER['HTTP_RANGE'] ?? '';

if (!isValidRange($range, $fileSize)) {
    http_response_code(416);
    header("Content-Range: bytes */$fileSize");
    exit;
}

Common Mistakes

⚠️

Mistake: Returning 400 instead of 416 for invalid byte ranges

Fix: Use 416 specifically when the Range header is syntactically valid but the requested range does not overlap the file. Use 400 only if the Range header itself is malformed.

Last updated: 21 Jun 2026