Brotli is a lossless compression algorithm and on-the-wire format specified in RFC 7932. It combines LZ77-style matching, Huffman coding, and context modeling for dense output at deflate-like speed.
Overview
Brotli targets generic data compression with ratios comparable to strong general-purpose codecs while staying in a similar performance class to deflate. Implementations ship as C libraries, command-line utilities, Python bindings, and packages in common Linux and macOS package managers.
The format is stream-oriented: it does not embed checksums or uncompressed lengths, and portions of a compressed stream can be altered without the decoder detecting tampering at the format layer. Build options include CMake installs, Bazel, vcpkg, and pip-installed Python modules for encoder and decoder use in applications.
Downstream projects include JavaScript decoders on npm, ports to other languages, compression benchmarks, and plugins for archivers. The project maintains issue tracking and mailing-list support for library questions separate from vulnerability reports.
Typical uses are shrinking HTTP responses, static assets, and arbitrary files where both compression ratio and decode speed matter for web and native clients.
Key features
- RFC 7932 compressed data format
- LZ77, Huffman, and context modeling
- C library and CLI binaries
- Python module via pip
- Package manager installs on Linux and macOS
- CMake and vcpkg builds
- Stream format without embedded checksums
- Third-party decoder ports
Use cases
- Compressing web assets and APIs
- Archiving files with strong ratios
- Embedding decode in mobile or JS apps
- Benchmarking against other codecs
- Python pipelines needing brotli wheels