When you see this status
- Client requests a byte range beyond file size with Range header
- Server cannot satisfy the requested range due to resource constraints
- File is empty but client requests a non-zero range
Common causes
- Invalid Range header value (e.g., bytes=1000-2000 for a 500-byte file)
- File truncated or modified after Range request
- Server misconfiguration of range handling
- Client assumes file is larger than actual size
How to debug it
- Verify the Range header in the request
- Check actual file size on the server
- Ensure range requests are supported by the server
- Validate client-side assumptions about file size
Return this code in your framework
Express (Node.js)
res.status(416).set('Content-Range', 'bytes */100').send('Range not satisfiable');
FastAPI (Python)
from fastapi import HTTPException
raise HTTPException(status_code=416, detail="Range not satisfiable")
NestJS
@Get()
async getFile(@Res() res: Response) {
res.status(416).set('Content-Range', 'bytes */100').send();
}
Go (net/http)
w.WriteHeader(http.StatusRequestedRangeNotSatisfiable)
w.Header().Set("Content-Range", "bytes */100")
About HTTP 416
HTTP status code 416 Range Not Satisfiable is part of the
4xx Client Error family. Client requested a file portion outside the server's available range. Understanding it is essential for
backend engineers, API designers, and anyone debugging integrations between services.
The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance:
what triggers them, how to debug them in production, and exactly how to return them from common
frameworks. Each code page is hand-curated and verified.