Testing

Brotli: Browser Support, Algorithm, vs Gzip

Brotli works in Chrome 50+, Firefox 44+, Edge 15+, Safari 11+ on macOS and iOS, Opera 38+, and Samsung Internet 5+. Learn Brotli browser support and quirks.

Author

Prince Dewani

May 2, 2026

Brotli is a lossless compression algorithm that Google engineers developed and the IETF standardized as RFC 7932 for HTTP encoding. It works in Chrome 50+, Firefox 44+, Opera 38+, Edge 15+, Safari 11+ on macOS and iOS, and Samsung Internet 5+, while Internet Explorer never added support.

This guide covers what Brotli is, the browsers that support it, how the algorithm works, how it compares to Gzip, how to enable it on a server, and the known issues.

What is Brotli?

Brotli is a general-purpose, lossless data compression algorithm that combines LZ77, Huffman coding, and second-order context modeling with a built-in static dictionary of around 13,000 web-friendly substrings. The IETF published it as RFC 7932, and browsers and servers use it for the Accept-Encoding: br HTTP content negotiation.

Which browsers does Brotli support?

Brotli is supported by every modern desktop and mobile browser through the Accept-Encoding: br HTTP header, with Chrome, Firefox, Opera, and Edge among the first to add it and Safari following on macOS and iOS.

Loading browser compatibility data...

Brotli compatibility in Chrome

Chrome supports Brotli from Chrome 50 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 49 had Brotli shipped but disabled by default, and Chrome 4 to 48 did not support it. Chrome only sends the Accept-Encoding: br header on HTTPS connections, so plain HTTP responses fall back to Gzip.

Brotli compatibility in Edge

Microsoft Edge supports Brotli from Edge 15 on Windows. The legacy EdgeHTML browser added it in version 15, and Chromium Edge from Edge 79 onward inherits Chrome's behavior, including the HTTPS-only Accept-Encoding restriction. Edge 12 to 14 did not support Brotli.

Brotli compatibility in Firefox

Firefox supports Brotli from Firefox 44 on Windows, macOS, Linux, and Android. Firefox only advertises br in the Accept-Encoding header over HTTPS, matching Chrome's behavior. Firefox 1 to 43 did not support Brotli, and Firefox for Android also gained support in version 44.

Brotli compatibility in Safari

Safari supports Brotli from Safari 11 on macOS High Sierra 10.13 and from Safari 11 on iOS 11 and iPadOS. Earlier Safari builds on macOS and iOS did not advertise br in the Accept-Encoding header, so older iPhones, iPads, and Macs fall back to Gzip on every request.

Brotli compatibility in Opera

Opera supports Brotli from Opera 38 on Windows, macOS, and Linux. Opera 36 and 37 had Brotli disabled by default, and earlier Opera versions did not support it at all. Opera Mobile supports Brotli from Opera Mobile 80 on Android, and Opera Mini does not support it in any version.

Brotli compatibility in Samsung Internet

Samsung Internet supports Brotli from Samsung Internet 5 on Galaxy phones and tablets. It is built on Chromium, so it follows the same HTTPS-only Accept-Encoding rules as Chrome for Android. Samsung Internet 4 did not support Brotli.

Brotli compatibility in Android Browser

Chrome for Android, the modern default browser on Android phones, supports Brotli from Chrome 50. The legacy stock Android Browser (AOSP) on Android 4.4 KitKat and earlier did not support Brotli. On modern Android phones, use Chrome for Android, Firefox for Android, or Samsung Internet for Brotli over HTTPS.

Brotli compatibility in Internet Explorer

Internet Explorer does not support Brotli in any version. IE 5.5 through IE 11 only accept gzip and deflate in the Accept-Encoding header. Microsoft has retired Internet Explorer, so production traffic from IE should fall back to Gzip or be redirected to Edge.

Note

Note: Brotli falls back to Gzip silently across older Safari, iOS, and HTTP-only origins. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

How does Brotli compression work?

Brotli combines three techniques to squeeze more out of web text than older compression formats. The result is roughly 15 to 20% smaller files than Gzip on JavaScript, HTML, and CSS at the same fidelity. Three building blocks drive the savings:

  • LZ77 backreferences: Brotli scans the input for repeated byte sequences and replaces later copies with short pointers back to the first match in a sliding window of up to 16 MB.
  • Huffman coding: The encoder rewrites the resulting symbols so that frequent ones use fewer bits, the same trick Gzip uses but tuned for web content patterns.
  • Second-order context modeling: Brotli predicts the next byte from the previous two bytes, letting the encoder pick a tighter Huffman table per context and shave more bits off the output.
  • Static dictionary: Brotli ships with a 120 KiB dictionary of around 13,000 web-friendly substrings such as common HTML tags, CSS keywords, and JavaScript identifiers, so frequent patterns compress without filling the sliding window.

Brotli also exposes 12 compression levels, from 0 (fastest) to 11 (smallest output). Servers usually run levels 4 to 6 on dynamic responses and level 11 on cached static assets that are compressed once at build time.

What is the difference between Brotli and Gzip?

Brotli and Gzip are both HTTP compression formats, but they differ on compression ratio, CPU cost, and tooling support. Gzip is the older default that every browser supports; Brotli is the newer, denser option for HTTPS traffic.

DimensionBrotliGzip
AlgorithmLZ77, Huffman coding, second-order context modeling, 120 KiB static dictionaryDEFLATE (LZ77 plus Huffman coding), no static dictionary
SpecificationRFC 7932RFC 1952
Compression levels0 to 11 (12 levels)1 to 9 (9 levels)
File size at top levelAbout 15 to 20% smaller than Gzip on JavaScript, HTML, and CSSBaseline for the comparison
Encoding speedSlow at level 11; comparable to Gzip at levels 4 to 6Fast at every level, faster than Brotli on hot dynamic responses
Browser reachChrome 50+, Firefox 44+, Edge 15+, Safari 11+, Opera 38+, Samsung Internet 5+. Not in IE.Every browser ever shipped, including IE 5.5+
Connection requirementHTTPS only in mainstream browsersHTTP and HTTPS
Best fitStatic assets compressed at build time, HTTPS-only sites, modern CDNsUniversal fallback, dynamic responses, legacy origin servers
...

How do you enable Brotli on your server?

Brotli is on by default in Cloudflare, Fastly, Akamai, and most major CDNs, but you may need to turn it on yourself for Nginx, Apache, or a custom origin. Follow these steps for the Nginx setup:

  • Install the Nginx Brotli module: On Debian or Ubuntu, run sudo apt install libnginx-mod-http-brotli-filter libnginx-mod-http-brotli-static to add the runtime filter and the static-asset modules.
  • Load the modules in nginx.conf: Add load_module modules/ngx_http_brotli_filter_module.so; and load_module modules/ngx_http_brotli_static_module.so; at the top of nginx.conf, above the events block.
  • Configure compression in a server block: Inside the server block, add brotli on;, brotli_comp_level 6;, and a brotli_types line listing MIME types such as text/css, application/javascript, application/json, text/html, and image/svg+xml.
  • Reload Nginx: Run sudo nginx -t to confirm the config parses, then sudo nginx -s reload so the new directives take effect without dropping live connections.
  • Confirm Brotli is active: From your terminal, run curl -I -H "Accept-Encoding: br" https://your-site.com/ and look for content-encoding: br in the response headers.

If the response still comes back as content-encoding: gzip, the Brotli module did not load or the request URL is on plain HTTP. Re-check the load_module lines and confirm the request used HTTPS.

What are the known issues with Brotli?

Brotli ships in every modern browser, but a few real edge cases still bite in production. The biggest hits are HTTPS-only behavior, slow encoding at the top compression level, and uneven origin-server defaults.

  • HTTPS-only in browsers: Chrome, Firefox, Edge, and Safari only advertise Accept-Encoding: br over HTTPS. Plain HTTP responses fall back to Gzip even when both client and server support Brotli.
  • Slow at level 11: Brotli level 11 produces the smallest output but is roughly 50 to 100 times slower to encode than Gzip 6, so it is impractical for dynamic responses. Reserve level 11 for static assets compressed once at build time.
  • Internet Explorer never supported it: IE 5.5 through 11 do not list br in Accept-Encoding. Sites that still serve IE traffic must keep a Gzip fallback in the response chain.
  • Origin servers default to Gzip: Nginx, Apache, IIS, and Tomcat ship Gzip on by default but require manual setup for Brotli, so dev and staging environments often serve Gzip and mask the real-world payload sizes a CDN will produce.
  • CDN re-compression varies by tier: Some CDNs strip Accept-Encoding: br on the way to the origin and re-compress at the edge, often at level 4. Static assets miss out on the level-11 savings unless you precompress and serve .br files directly.
  • No standalone DecompressionStream support: The DecompressionStream API supports gzip and deflate-raw widely, but the br format is only standardized in Chromium-based browsers, so client-side Brotli decoding still needs a polyfill on Firefox and Safari.

In my experience, the most surprising failure is a CDN silently downgrading to level 4 on the edge while the origin pre-built level-11 files. The fix is to serve the precompressed .br files directly with brotli_static on; in Nginx so the CDN passes them through without re-encoding.

...

Citations

All Brotli version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests