DevKits

Content · Response header

Content-Encoding

How the body has been transparently encoded (usually compressed).

What is Content-Encoding?

Content-Encoding tells the client that the payload has been transformed — typically compressed with gzip, br (Brotli), or deflate — and must be decoded before the underlying Content-Type applies. Enabling compression can cut transfer size by 70–90%.

Typical usage

Set by servers when serving compressed responses. Clients advertise which encodings they accept with Accept-Encoding.

Examples

Brotli-compressed HTML

Content-Encoding: br

gzip-compressed JSON

Content-Encoding: gzip

Common gotchas

Do not confuse Content-Encoding (transport transformation) with the media type application/gzip (the resource itself is a gzip file). The two mean different things.

Specification

RFC 9110 §8.4

Related headers