Gzip Compression Calculator
Fast, accurate and free online kompresji gzip calculator tool running directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulGzip Compression Calculator - Check Size Before and After
Gzip is a lossless compression algorithm used to transfer web resources (HTML, CSS, JS, JSON). The server compresses, the browser decompresses - the user doesn't see the difference, but the page loads faster. The tool shows how much your data will be compressed.
How Gzip compression works
Gzip uses the DEFLATE algorithm (LZ77 + Huffman encoding). LZ77: replaces repeated sequences with pointers to previous occurrences. Huffman: encodes symbols with shorter codes based on frequency. Result: Repeating patterns (common in HTML/CSS/JS) compress perfectly (60-90% reduction).
Compression levels (1-9)
Level 1 (fastest, lowest compression): approximate compression, lowest CPU. Level 6 (nginx/apache default): optimal balance of speed and compression. Level 9 (maximum): best compression, ~10-20% slower than level 6. For static resources: compress once to level 9 (pre-compression). For dynamic people: level 1-4.
Compression rate of various file types
HTML: 60-85% reduction (many repeated tags). CSS: 70-85%. JavaScript: 60-80%. JSON API response: 70-90% (keys and patterns are repeated). Fonts (WOFF2): 0-5% (already compressed). Images (JPEG, PNG, WebP): 0-5% (already compressed). Video: 0-2%.
Brotli vs Gzip vs Deflate
Brotli (Google, 2015): 15-25% better compression than Gzip for text. Support: all modern browsers (Chrome, Firefox, Edge, Safari). Servers: nginx (1.11.5+), Apache (mod_brotli). Gzip: common standard, older browsers. Deflate: old variant, still supported.
FAQ
How to enable Gzip compression in nginx?
gzip on; gzip_types text/plain text/css application/javascript application/json image/svg+xml text/xml; gzip_min_length 1000; gzip_comp_level 6; gzip_vary on;. Check: curl -I -H "Accept-Encoding: gzip" URL | grep Content-Encoding. Result: "Content-Encoding: gzip" = enabled.
How to enable Gzip in Apache/.htaccess?
What is Transfer-Encoding: chunked and Content-Encoding: gzip?
Content-Encoding: gzip: content is Gzip compressed (decompress on receipt). Transfer-Encoding: chunked: content sent in chunks (streaming, without Content-Length). Both can be combined: chunked transfer + gzip compression. HTTPS already encrypts data - it is an additional layer for content compression.
What files should NOT be compressed with Gzip?
Already compressed: JPEG, PNG, WebP, AVIF, GIF, MP4, WebM, ZIP, PDF, WOFF2. Small files (<1KB): Gzip header overhead (18-20 bytes) is proportionately large. Effect: nginx gzip_min_length 1000 skips files <1KB.
How do I measure the performance impact of Gzip compression?
Chrome DevTools → Network: "Size" (compressed) vs "Content" (original) column. PageSpeed Insights: "Enable text compression" – audit. Lighthouse: similar. WebPageTest: detailed entities per resource. Target: Text resources > 1KB should have Content-Encoding: gzip or br.
Related tools: JSON API formatter, YAML validator and Base64 converter.