How to open .BR files on Linux
To open .BR files on Linux, decompress the file using Brotli tooling (the reference brotli utilities are commonly used) to produce the original uncompressed file.
Step-by-step instructions
- Decompress the file using Brotli tooling (the reference brotli utilities are commonly used) to produce the original uncompressed file.
- Open the decompressed output using the appropriate program (e.g., a text editor for .js/.css/.html).
Common issues
Decompression produces an unknown or extensionless file
A .br file is just compressed data; it may not include the original filename or extension, especially when it was created for web serving (e.g., "main.js.br" implies the output should be "main.js").
- Look at the original context or name (e.g., "style.css.br" should decompress to "style.css").
- After decompressing, add the correct extension based on what the file is (CSS/JS/HTML/WASM are common for web assets).
The file won’t open in a browser or editor
Trying to open the compressed .br directly will show garbled data because it must be decompressed first.
- Decompress the .br with a Brotli-capable tool (such as the official brotli utilities).
- Open the decompressed output with the appropriate program (text editor for source files, etc.).
Website serves a .br file as a download instead of loading normally
On the web, Brotli is meant to be delivered using HTTP content coding (Content-Encoding: br). If a server is misconfigured, it may serve the pre-compressed file as if it were the actual resource or omit the correct headers.
- If you manage the site, ensure Brotli is delivered as HTTP content coding "br" (Content-Encoding: br) rather than exposing the .br file directly.
- Verify the server sets appropriate headers and serves the original resource URL while using Brotli encoding for transport.
Security note
.br is compressed data; decompressing untrusted .br files can consume significant CPU/memory (a common risk with compressed inputs), so be cautious with very large or unexpected files.