# Brotli compression

> Brotli is a lossless compression format for web text, sent as Content-Encoding: br. See web.dev

Canonical: https://scaplet.com/glossary/brotli-compression

Glossary Glossary · Performance

Brotli is a lossless compression format for web text, sent as Content-Encoding: br. See web.dev's gzip comparison, compression levels and how to check your server.

3 min

read

5

sources

Oct 21, 2026

updated

Scaplet Editorial Team

author

In one line

Brotli is a lossless compressed data format, defined in RFC 7932, that web servers can use to shrink text assets before sending them. Browsers ask for it with Accept-Encoding and servers answer with Content-Encoding: br. Web.dev lists it with gzip as a commonly used algorithm that performs best on text such as HTML, CSS and JavaScript.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fbrotli-compression%20(%22Brotli%20compression%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fbrotli-compression%20(%22Brotli%20compression%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fbrotli-compression%20(%22Brotli%20compression%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fbrotli-compression%20(%22Brotli%20compression%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 3 minutes.

1. [What Brotli is 01](#what-brotli-is)
2. [How the browser and server agree on it 02](#how-the-browser-and-server-agree-on-it)
3. [Brotli vs gzip: the numbers 03](#brotli-vs-gzip-the-numbers)
4. [Settings that matter 04](#settings-that-matter)
5. [Check it in 2 minutes 05](#check-it-in-2-minutes)

_01_Explained

## What Brotli is

RFC 7932 defines Brotli as "a lossless compressed data format that compresses data using a combination of the LZ77 algorithm and Huffman coding, with efficiency comparable to the best currently available general-purpose compression methods." The RFC is informational, from the IETF, and its authors are at Google.

On the web it is one of the HTTP content encodings. MDN lists `br` as "A format using the Brotli algorithm structure (defined in RFC 7932)" alongside `gzip`, `deflate` and `zstd`. It is the same job as [gzip compression](/glossary/gzip-compression): make text responses smaller so pages load sooner.

_02_Check it

## How the browser and server agree on it

The browser lists the encodings it accepts in the `Accept-Encoding` request header. The server picks one and names it in the `Content-Encoding` response header. MDN's example of a browser's preference:

Web.dev says all modern browsers support gzip and Brotli and advertise both. Google's crawlers support them too: Google lists gzip, deflate and Brotli (br) as supported content encodings, and the crawler's own `Accept-Encoding` header advertises them, for example `Accept-Encoding: gzip, deflate, br`.

Request and response headers

```
Accept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1 Content-Encoding: br
```

_03_web.dev examples, uncompressed vs compressed size

## Brotli vs gzip: the numbers

Web.dev's text compression guide shows both algorithms on the same files:

File

### angular-1.8.3.js

Uncompressed

1,346 KiB

gzip

329 KiB (76%)

Brotli

256 KiB (81%)

File

### angular-1.8.3.min.js

Uncompressed

173 KiB

gzip

60 KiB (65%)

Brotli

53 KiB (69%)

Percentages are the compression ratios web.dev reports. Brotli is smaller on both files, and the gap is larger on the unminified one. Web.dev adds that both algorithms often reach compression rates as high as 70-90% for larger text files.

_04_At a glance

## Settings that matter

Web.dev says gzip levels run from 1 to 9 and Brotli levels from 0 to 11, with the highest being best but slowest. Its advice depends on when you compress:

Method

### Dynamic

What it means

Compressed at the time of the request

Level advice from web.dev

Settings in the middle of the range tend to offer the best trade-off between ratio and speed

Method

### Static

What it means

Compressed ahead of time, for example at build

Level advice from web.dev

Can use the most aggressive setting, since the cost is paid once

Compression helps text-based assets: HTML, CSS, JavaScript. Web.dev warns that running these algorithms on assets already compressed, such as most image formats, yields little to no improvement. Many CDNs offer automatic compression, so check yours before configuring the origin. Web.dev says compressing text-based assets lets a page spend less time loading resources, which helps [page speed](/glossary/page-speed).

_05_Check it

## Check it in 2 minutes

Ask for Brotli and read which encoding comes back:

If you see `content-encoding: br`, Brotli is on for that response. If it prints `gzip` or nothing, the server chose another encoding or isn't compressing that resource. Test a CSS or JavaScript file as well, because servers often configure compression per file type. Web.dev notes it is the hosting provider's responsibility to configure the server to serve the compressed resource when the client requests it.

Request a page with Brotli accepted

```
curl -sI -H "Accept-Encoding: br" https://example.com/ | grep -i content-encoding
```

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What is Brotli encoding?

It is the `br` HTTP content encoding: a lossless compression format defined in RFC 7932 that servers can use to send smaller HTML, CSS and JavaScript responses.

_02_ Is Brotli better than gzip?

In web.dev's examples it produced smaller files than gzip on both a raw and a minified JavaScript file. Compression level and whether you compress statically or dynamically also matter.

_03_ Does Google support Brotli?

Yes. [Google's crawler](/ai-crawlers/googlebot) documentation lists gzip, deflate and Brotli (br) as supported content encodings.

_04_ Should I use the highest Brotli level?

For files compressed ahead of time, yes, the extra time is paid once. For responses compressed on request, web.dev advises mid-range settings as the better trade-off between ratio and speed.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- mozilla.org
- web.dev
- google.com

1. 01 [RFC 7932: Brotli Compressed Data Format](https://www.rfc-editor.org/rfc/rfc7932) rfc-editor.org · checked 2026-10-25
2. 02 [MDN: Accept-Encoding header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Encoding) developer.mozilla.org · checked 2026-10-25
3. 03 [MDN: Content-Encoding header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding) developer.mozilla.org · checked 2026-10-25
4. 04 [web.dev: Optimize the encoding and transfer size of text-based assets](https://web.dev/articles/optimizing-content-efficiency-optimize-encoding-and-transfer) web.dev · checked 2026-10-25
5. 05 [Google crawling infrastructure: Overview of Google crawlers and fetchers](https://developers.google.com/crawling/docs/crawlers-fetchers/overview-google-crawlers) developers.google.com · checked 2026-10-25

## Keep learning

[All glossary](/glossary)

[Learn HTTP/2 Performance](/glossary/http-2) [Related Page speed Performance](/glossary/page-speed) [Read next Gzip compression Performance](/glossary/gzip-compression) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Broken link building](/glossary/broken-link-building) [Broken links](/glossary/broken-links) [Bulk data export](/glossary/bulk-data-export) [Burn rate](/glossary/burn-rate)

More in Performance
[Speculation rules](/glossary/speculation-rules) [Speed Index](/glossary/speed-index) [SVG](/glossary/svg) [Synthetic monitoring](/glossary/synthetic-monitoring) [Time to First Byte (TTFB)](/glossary/time-to-first-byte) [Time to Interactive (TTI)](/glossary/time-to-interactive) [Total Blocking Time (TBT)](/glossary/total-blocking-time) [TTL (time to live)](/glossary/ttl) [Viewport meta tag](/glossary/viewport-meta-tag) [WebP](/glossary/webp) [AVIF](/glossary/avif) [bfcache (back/forward cache)](/glossary/bfcache) [Brotli compression](/glossary/brotli-compression) [Cache-Control](/glossary/cache-control) [CDN](/glossary/cdn) [Chrome UX Report (CrUX)](/glossary/chrome-ux-report) [Content Security Policy](/glossary/content-security-policy) [Content-Length (HTTP header)](/glossary/content-length) [Core Web Vitals](/glossary/core-web-vitals) [Core Web Vitals report](/glossary/core-web-vitals-report) [CORS](/glossary/cors) [Critical CSS](/glossary/critical-css) [Critical rendering path](/glossary/critical-rendering-path) [Cumulative Layout Shift (CLS)](/glossary/cumulative-layout-shift)

Terms on this page
[Gzip compression](/glossary/gzip-compression) [Page speed](/glossary/page-speed)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
