Brotli Compress & Decompress Online

Compress text or files with Brotli at any quality from 0 to 11, decompress .br data, and compare the result against gzip — all locally in your browser.

Runs in your browserUpdated
Open file

Compare algorithms

See how small your input gets with each algorithm and level.

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Brotli Compress & Decompress

  1. Choose Compress or Decompress; Brotli is preselected.
  2. Paste text or open a file. To decompress, paste Base64 / hex or open a .br file.
  3. Pick a quality: 4–6 for on-the-fly compression, 11 for files you compress once.
  4. Use Compare algorithms to see Brotli and gzip side by side, then download the result.

What is Brotli?

Brotli is a lossless compression format developed at Google and standardised as RFC 7932. Like gzip it combines LZ77 matching with Huffman coding, but it adds a much larger match window, context modelling and a built-in dictionary of about 120 KB of common words and HTML, CSS and JavaScript fragments. The result is typically 15–25 % smaller than gzip on web text, which is why every modern browser accepts Content-Encoding: br.

Brotli quality levels

QualitySpeedTypical use
0–3Very fastLive streams, very high request rates
4–6Fast — similar to gzip -6Dynamic HTML and API responses (Cloudflare and nginx defaults are in this range)
7–9ModerateMid-sized cached responses
10–11Slow, smallest outputStatic assets pre-compressed at build time

Decompression is fast at every quality, so the cost of quality 11 is paid only once, when you build your site. That makes it ideal for CSS and JavaScript bundles served as pre-compressed .br files.

Brotli vs gzip

  • Size: Brotli wins on almost all text; the gap is largest for small files thanks to the built-in dictionary.
  • Speed: at quality 11 Brotli is much slower to compress than gzip -9; at quality 4–5 it is comparable.
  • Support: all current browsers accept Brotli over HTTPS. gzip remains the safe fallback for old clients and tools.
  • No file signature: Brotli streams have no magic bytes, so tools cannot auto-detect them — choose the Brotli option when decompressing.

How this tool works

The official Brotli library is compiled to WebAssembly and loaded the first time you use it (about 1 MB, cached afterwards). Your data never leaves the browser. Check whether your own site already serves Brotli with the website compression test.

Tools that pair well with the Brotli Compress & Decompress

  • JavaScript Minifier — Paste JavaScript and get production-ready minified code from Terser — the same engine used by Vite, webpack and Rollup — with real before/after and gzipped sizes.
  • HTML Minifier — Shrink HTML pages and templates by removing comments and redundant whitespace, minifying inline <style> and <script>, and cleaning up attributes — while keeping the layout identical.
  • CSS Minifier — Paste a stylesheet to shrink it instantly.
  • JSON Minifier — Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.

Frequently asked questions

How much smaller is Brotli than gzip?
On HTML, CSS and JavaScript Brotli is usually 15–25 % smaller than gzip at its default level, and more on small files. Click Compare algorithms to measure your own input.
Why does decompression fail with “not valid Brotli data”?
Brotli has no header, so any wrong or truncated input fails. Make sure the data is really Brotli (not gzip) and that the Base64 string is complete.
Which Brotli quality should my server use?
Use 4–6 for responses compressed on every request and 11 for static files you compress ahead of time during the build.
Do all browsers support Brotli?
Yes, every current browser supports Brotli over HTTPS. Servers should still offer gzip as a fallback for older clients and command-line tools.

Related tools