How to use the Brotli Compress & Decompress
- Choose Compress or Decompress; Brotli is preselected.
- Paste text or open a file. To decompress, paste Base64 / hex or open a
.brfile. - Pick a quality: 4–6 for on-the-fly compression, 11 for files you compress once.
- 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
| Quality | Speed | Typical use |
|---|---|---|
| 0–3 | Very fast | Live streams, very high request rates |
| 4–6 | Fast — similar to gzip -6 | Dynamic HTML and API responses (Cloudflare and nginx defaults are in this range) |
| 7–9 | Moderate | Mid-sized cached responses |
| 10–11 | Slow, smallest output | Static 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.