The Ultimate Guide to HTTP Status Codes (100–599)
A complete reference guide to all HTTP status codes from 100 to 599, with explanations and common use cases.
Feb 28, 2026
4xx Client Error
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.
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;
}
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.