</> HTML Compression Test

HTML Compression Test — Minifier & Gzip Checker

Minify HTML to reduce file size, or test if your server sends gzip/brotli compression. See bytes saved, estimated compressed sizes, and optimization recommendations.

HTML minifier Gzip estimate Brotli estimate HTTP compression test Free
Options:
Original HTML
Minified Output
0 chars 0 B
0 Original
0 Minified
0% Reduced
0 Bytes saved
gzip estimate
~75% compression
~0 KB
brotli estimate
~80% compression
~0 KB
Total transfer size (minified + gzip)
What the browser receives
~0 KB
```
HTTP Compression Test — Coming Soon This tab will check if your server sends gzip or brotli Content-Encoding headers. Server-side infrastructure is required and currently in development.
Response Headers
content-encodingpending
content-typepending
content-lengthpending
varypending
cache-controlpending
Compression Analysis
gzip enabledpending
brotli enabledpending
compressed sizepending
uncompressed sizepending
reductionpending
What this test checks
📦Content-Encoding header — gzip, br (brotli), deflate, or none
📊Compressed vs uncompressed response size and reduction percentage
🛠Vary: Accept-Encoding header — required for CDN caching of compressed responses
Cache-Control headers — correct caching of compressed assets
🔒HTTPS — required for brotli compression in most browsers

// Two types of HTML compression

HTML Minification vs HTTP Compression — What Is the Difference?

Both techniques reduce the amount of data transferred when a browser loads your page, but they work at different levels and can be combined for maximum impact.

Client tool

HTML Minification

Removes whitespace, comments, optional closing tags, and redundant attributes from HTML source. Typical reduction: 5-20%.

Server config

gzip Compression

The web server compresses HTML before sending. The browser decompresses automatically. Typical reduction: 70-80%. Configured in Apache, Nginx, or CDN.

Server config

Brotli Compression

15-25% better than gzip for HTML. Requires HTTPS. Supported by all modern browsers. Typical reduction: 75-85%. Available in Nginx 1.11.6+.


// Common questions

What Developers Ask About HTML Compression

Does HTML minification break my website?
Removing whitespace between block elements is always safe. Whitespace inside inline elements can sometimes affect visual spacing. Removing comments is safe unless you use conditional IE comments. Minifying inline JavaScript is the riskiest step — always test after enabling this option.

How do I check if gzip is enabled on my server?
In Chrome DevTools: open Network tab, click any HTML request, check Response Headers for content-encoding: gzip or content-encoding: br. In curl: run curl -H "Accept-Encoding: gzip" -I https://yoursite.com. The HTTP Compression Test tab (coming soon) automates this.

Should I use gzip or brotli?
Use brotli if your server supports it — better compression with no downside for modern browsers. Keep gzip as a fallback. Most CDNs (Cloudflare, Fastly, AWS CloudFront) support both automatically. For Nginx, install the ngx_brotli module and configure both.


// FAQ

Frequently Asked Questions

HTML compression refers to two techniques: minification (removing whitespace and comments) and HTTP compression (gzip/brotli from the server). Minification reduces raw file size by 5-20%. HTTP compression reduces transfer size by 70-85%. Use both for maximum impact.
gzip typically compresses HTML by 70-80%. A 100KB file becomes approximately 15-25KB for transfer. Brotli achieves 75-85%. The exact ratio depends on content repetition.
Yes, indirectly. Page speed is a ranking factor. HTML compression reduces TTFB and improves LCP. Google PageSpeed Insights flags missing text compression as an opportunity. Enabling gzip/brotli is one of the fastest performance wins.
gzip finds repeated byte sequences and replaces them with short references — HTML has huge repetition in tags and attributes. Minification only removes whitespace, a small fraction of file size. Minification plus gzip is better than gzip alone.