416 Range Not Satisfiable
The requested byte range lies outside the size of the target resource, often during a resumed or partial download.
The Range header requests a portion of the file that the server cannot supply.
What HTTP 416 Range Not Satisfiable Means
The Range header requests a portion of the file that the server cannot supply.
The requested byte range lies outside the size of the target resource, often during a resumed or partial download.
Common Causes
- Requested range starts beyond the file size
- Stale range from an interrupted download
- Incorrect Range header math in the client
How to Fix It (For Visitors)
- Restart the download from the beginning
How to Fix It (For Developers/Admins)
- Validate Range against the current resource length
- Return a Content-Range header with the valid size
- Send 200 with the full body if the range is invalid
Returning a 416 Range Not Satisfiable (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 416 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(416).json({ error: 'Range Not Satisfiable' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Range Not Satisfiable'), 416
PHP
<?php
http_response_code(416);
header('Content-Type: application/json');
echo json_encode(['error' => 'Range Not Satisfiable']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 416 Range Not Satisfiable
Frequently Asked Questions
What does HTTP 416 Range Not Satisfiable mean?
The requested byte range lies outside the size of the target resource, often during a resumed or partial download. In short: The Range header requests a portion of the file that the server cannot supply.
Is 416 Range Not Satisfiable a client or server error?
416 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.
How do I fix a 416 Range Not Satisfiable error?
Validate Range against the current resource length. Return a Content-Range header with the valid size. Send 200 with the full body if the range is invalid.
Official Specification
The 416 Range Not Satisfiable status code is defined in RFC 9110 Section 15.5.17.