Search Tools

HTTP Byte Ranges and Selected Length

Normalize an HTTP GET Range request to byte positions in the selected representation and estimate the selected length

Endpoints are inclusive, so 0-499 contains 500 bytes. The sum of multiple ranges counts overlaps, while the main result counts each selected byte once.

The displayed value is the selected data length, not network traffic including multipart boundaries and headers.

Enter a nonnegative integer. This is the representation length after Content-Encoding is applied.

Example: bytes=0-499,-500. You may also paste a line beginning with Range: (up to 128 ranges).

Excludes other conditional GET outcomes of 304/412 and methods other than GET.

Results

Results update automatically when the required values are entered.

Report an issue

Method, applicability and sources

Calculation method

RFC 9110 §14.1.2: offsets start at 0 and include the end position; interval length = end − start + 1. An open-ended start- range extends to total length − 1. A suffix -N selects at most the final N bytes. An end beyond the representation is clamped to total length − 1. Requested ranges retain their input order; overlapping and adjacent intervals are merged to calculate the union length. Out-of-range members do not add to the selected length. An unsatisfiable byte-range-set can lead to 416 with Content-Range: bytes */total-length, but a server may instead ignore Range. For total length 0, a nonzero suffix can meet the RFC's satisfiability condition while identifying no actual byte positions, so no Content-Range for 206 can be generated.

Worked example (hypothetical values)

For a representation of 10000 bytes, bytes=0-499,-500 normalizes to 0-499 and 9500-9999. Both the union and sum of individual lengths are 1000 bytes. For bytes=500-700,601-999, the individual sum is 600 bytes and the union is 500 bytes.

Applicability and limitations

HTTP GET range processing where the selected representation's encoded byte length is known. Does not fetch the resource, guarantee that a server accepts Range, compare If-Range ETags or dates, evaluate preconditions leading to 304/412, calculate multipart boundaries or part-header transfer overhead, determine HEAD/POST body lengths, or parse unknown range units.

Methods used

  • HTTP GET byte-range-set (RFC 9110 (June 2022)): scope GET preconditions before range evaluation are satisfied and the representation length is known; region global

Method and sources

Method: RFC 9110(2022-06)§§5.6.1, 13.1.5, 14.1.1–14.2, 14.4, 15.5.17. Data recorded: 2026-11-14.