HTTP 416 Error Range Not Satisfiable: What is it and how to fix it?

HTTP 416 Error Range Not Satisfiable: What is it and how to fix it?

When developing or maintaining web applications that serve downloadable content (like video, audio, or large files), you may encounter the HTTP 416 error, officially known as “416 Range Not Satisfiable”.

Although you may have never encountered this error before, it is a valid HTTP status code that can help you identify the issue with your web applications.

What Is the HTTP 416 Error?

The HTTP 416 (Range Not Satisfiable) status code is returned by a server when the client requests a portion of a resource (using the Range header) that the server cannot provide.

The Range header is typically used when downloading larger files in chunks, when resuming interrupted downloads, or when streaming audio or video. For example, if the client tries to request:

Range: bytes=1000000-2000000

But the file only has 500,000 bytes, the server will respond with:

HTTP/1.1 416 Range Not Satisfiable
Content-Range: bytes */500000

This means the client has asked for bytes that are outside the bounds of the resource.

When can you typically encounter the HTTP 416 error?

The error always occurs when the Range header is present. Like in the previously explained scenarios:

  1. Resuming Downloads with an Invalid Offset
    When a user resumes a partially downloaded file, the browser (or download manager) may request a byte range that no longer exists — for example, if the file has been updated or deleted.
    Example: A 5MB video was partially downloaded, but then updated to 3MB. A resume request to byte 5000000 will fail.
  2. Buggy JavaScript Media Players
    Many custom audio/video players use Range headers to load specific chunks. If the script calculates the ranges incorrectly, users may see broken media or the 416 error in DevTools.
  3. Manual resource or API Range Requests
    In APIs or CLI tools (like curl), developers sometimes explicitly request invalid ranges while testing or scripting downloads.
    curl -H “Range: bytes=99999999-100000000” http://example.com/video.mp4
    If the file isn’t that large, the request fails with a 416 status code.
  4. Serving Empty or Corrupt Files
    If a server tries to respond to a Range request on an empty file (0 bytes), any range requested will be invalid.

How to resolve the 416 error code

Clear Browser Cache

First and foremost, try clearing your browser cache and then attempting the process again. Sometimes, some resources may be updated while still retaining the old cached content. You can follow the steps to clear the browser cache on both Chrome and Firefox.

For Firefox

  1. Open Firefox.
  2. Click the menu (☰) in the top-right corner.
  3. Go to Settings (or Preferences on macOS).
  4. Click Privacy & Security on the left.
  5. Scroll to the Cookies and Site Data section.
  6. Click Clear Data.

For Chrome

  1. Open Chrome.
  2. Click the menu (⋮) in the top-right corner.
  3. Go to Settings > Privacy and security > Clear browsing data.
  4. Under the Basic tab:
    o Time range: choose “All time” (or as needed)
    o Check Cached images and files
  5. Click Clear data.
    Stop the download file and try downloading it again
    When downloading larger files, the download may be interrupted, and after resuming, you may encounter the 416 error message. However, don’t worry; restart the download from the beginning, and most of the time, the issue should be resolved.

Check the application or Apache/Nginx logs.

To gain a better understanding of what might be causing the issue, you can review the Apache/Nginx or application logs to investigate further and identify more detailed messages that may reveal the exact cause of the 416 error. For Apache web servers, you can check if the mod_headers is enabled and if Accept-Ranges is correctly configured. If you are still experiencing the issue, you can also disable range requests, which is not recommended for websites with a large number of media resources. You can disable range requests by adding the following line to the .htaccess file.

Header unset Accept-Ranges

Conclusion

The HTTP 416 error can be particularly challenging, especially when handling media files or partial content delivery. Understanding how Range headers work and ensuring your server or app respects content boundaries is key to avoiding this issue. Whether you’re an end-user, developer, or sysadmin, a systematic approach will help you resolve the 416 error effectively.

Of course, you can always contact our technical support. You only need to sign up for one of our VPS plans and submit a support ticket. We are available 24/7 and will take care of your request immediately.

Leave a Comment