← Back to Chapters

416 Range Not Satisfiable

? 416 Range Not Satisfiable

? Quick Overview

HTTP status code 416 Range Not Satisfiable occurs when a client requests a byte range that the server cannot provide. This usually happens when the requested range is outside the size of the target resource.

? Key Concepts

  • Used with the Range request header
  • Common in download managers and media streaming
  • Triggered by invalid or out-of-bounds byte ranges
  • Server may include Content-Range in response

? Syntax / Theory

Clients use the Range header to request partial content. If the range exceeds the file size, the server responds with 416.

? View Code Example
// Requesting bytes beyond file size
GET /video.mp4 HTTP/1.1
Host: example.com
Range: bytes=999999-1000000

?️ Code Example(s)

? View Code Example
// Node.js example sending 416 response
res.status(416).set("Content-Range","bytes */5000").end();

? Live Output / Explanation

Server Response

The server rejects the request because the range does not exist within the resource size. The client should retry with a valid byte range.

? Interactive Explanation

Imagine a file that is 1000 bytes long (indices 0-999). Use the simulator below to test different ranges.

? Request Simulator

Range: bytes= -
Click "Send" to test the status code...

? Use Cases

  • Video and audio streaming errors
  • Resumable download failures
  • Corrupt cached range requests
  • Misconfigured client-side logic

✅ Tips & Best Practices

  • Always validate file size before sending Range headers
  • Handle 416 responses gracefully on the client
  • Clear cache if repeated range errors occur
  • Use Content-Range for debugging

? Try It Yourself

  • Request a range larger than an actual file
  • Test range requests using browser DevTools
  • Simulate partial content in a local server
  • Observe how different browsers handle 416