Skip to main content

Brotli Compression Encoder/Decoder

Compress or decompress data with Brotli — the algorithm behind modern HTTP content-encoding — right in your browser, with size and ratio stats. Free in the browser (WASM); also available as a paid API (Node's native zlib).

Input

Or

0 = fastest, 11 = best compression (slower).

Loading compression engine…

Output

Add text or a file and press Compress — everything runs in your browser.

Was this helpful?

Guides

Compress or decompress data with Brotli — the algorithm Google built for content-encoding on the modern web. Paste text or drop a file, pick a compression level, and get the result plus size and ratio stats — all in your browser.

How to use it

  1. Choose Compress or Decompress.
  2. Drop a file, or paste text (for Compress) / Base64-encoded Brotli data (for Decompress) into the text box.
  3. For Compress, set the Compression level — 0 is fastest, 11 squeezes the smallest output but takes longer.
  4. Press Compress or Decompress. The tool shows the Base64 output (copy or download it as text) alongside a stats table — original size, compressed size, and the compression ratio — plus a Download raw file button for the actual .br bytes rather than Base64 text.

Free in your browser, private by default

Everything runs client-side via a WebAssembly build of Brotli — your file or text is never uploaded. The compression level and mode never leave your device either.

Is there an API?

Yes. The same codec is available as a paid developer API (POST /v1/tools/brotli-compression) for scripts and backends where running a browser isn't practical. The API runs Node's own built-in Brotli support (zlib.brotliCompressSync/brotliDecompressSync, native since Node 11) and costs one credit per call; the input and output are Base64-encoded bytes since binary can't cross a JSON string field. The in-browser tool on this page stays free.

Brotli vs. gzip vs. zstd

Brotli, gzip/zlib/deflate, and Zstandard are all general-purpose lossless compressors, but they trade off differently. Brotli typically compresses text (HTML, CSS, JS) tighter than gzip at a similar speed, thanks to a built-in dictionary of common web strings — it's why most CDNs and browsers prefer it for HTTP responses today. Zstandard usually compresses faster than Brotli at comparable ratios and shines on very large or already-mixed binary data. Gzip/deflate remain the most universally supported format, including by tools that predate Brotli entirely.

What if my data isn't already Base64?

Paste plain text directly (mode: Compress) — the tool encodes it to UTF-8 bytes for you. If you already have raw Brotli-compressed bytes (a .br file, or output from another tool), upload the file directly rather than Base64-encoding it by hand.

Related tools

For the older, more universally-supported DEFLATE family (gzip, zlib, raw deflate), see the Gzip/Zlib/Deflate Tester. For a faster-but-larger alternative built for speed over ratio, try the LZ4 Compression Tool.

brotlicompressiondecompressiongzipzstdwasmbase64zlib

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/brotli-compression \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "SGVsbG8sIEJyb3RsaSBjb21wcmVzc2lvbiEgQnJvdGxpIGlz…",
    "mode": "compress",
    "quality": "11"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `brotli-compression` tool (Brotli Compression Encoder/Decoder) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.