Content-Range

When a server delivers only part of a resource, the HTTP Content-Range response header identifies which byte range the message contains and the total resource size.

Usage

The Content-Range header appears in 206 Partial Content responses when a server fulfills a Range request by delivering only part of a resource. The header specifies the byte range of the partial content and the total size of the complete resource.

Range requests enable efficient downloads. A client interrupted during a large file transfer resumes from where the connection dropped instead of starting over. Media players use range requests to seek to specific positions in audio or video files without downloading the entire stream.

Servers advertise range request support through the Accept-Ranges header, typically set to bytes. When a range request asks for a byte range beyond the resource boundary, the server responds with 416 Range Not Satisfiable and includes a Content-Range header showing the actual resource size.

The syntax follows a structured format with three components: the unit (almost always bytes), the byte range, and the complete size.

Content-Range: <unit> <range-start>-<range-end>/<size>

Values

unit

The unit type for the range. The value bytes is the only widely implemented unit.

range-start

A zero-based integer indicating the first byte of the returned range.

range-end

A zero-based integer indicating the last byte of the returned range, inclusive.

size

The total size of the complete resource in bytes. An asterisk (*) replaces the size when the total length is unknown, as with streaming or dynamically generated content.

Example

A client resumes a download after receiving the first 1,000 bytes of a 65,000-byte file. The request asks for Range: bytes=1000- and the server returns the remainder, bytes 1000 through 64999 inclusive.

Content-Range: bytes 1000-64999/65000

A media player seeks into a file and asks for a window of bytes rather than the rest. The server returns bytes 1000 through 2000 inclusive, 1,001 bytes in total.

Content-Range: bytes 1000-2000/65000

A streaming resource delivers a range without knowing the total size. The asterisk indicates an unknown complete length.

Content-Range: bytes 1000-2000/*

A server rejects a range request because the requested bytes exceed the resource size. The response carries a 416 Range Not Satisfiable status and reports the actual size.

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

A multipart range response delivers multiple ranges in a single response. Each part includes its own Content-Range header within the multipart/byteranges body.

HTTP/1.1 206 Partial Content
Content-Type: multipart/byteranges; boundary=BOUNDARY

--BOUNDARY
Content-Type: text/plain
Content-Range: bytes 0-499/10000

[first 500 bytes]
--BOUNDARY
Content-Type: text/plain
Content-Range: bytes 9500-9999/10000

[last 500 bytes]
--BOUNDARY--

Content-Range in PUT requests

Some origin servers accept a partial PUT, where Content-Range in the request states which part of the stored resource the enclosed bytes replace. Support depends on a private agreement between client and server, and an origin receiving Content-Range on a PUT it does not support partially answers 400 rather than silently writing the fragment as the whole resource. Upload resumption protocols build on this idea or on PATCH, and a client sending the header without confirming support risks either outcome.

See also

Last updated: November 3, 2026