GZip Compressor
Compress and decompress text with gzip, deflate, or deflate-raw
About
Compress text into gzip, deflate, or deflate-raw and decompress it back, using the browser's native CompressionStream/DecompressionStream. Output is base64-encoded and the compressed size and ratio are shown. Everything runs locally; nothing is uploaded.
Examples
Compress text to gzip
text: The quick brown fox jumps over the lazy dog.H4sIAAAAAAAAA3PP0sivyCxIVAguLilK5XBkBQAQ/wb/EAAAAA== (gzip, base64)
Compressed: 52 bytes (original: 45 bytes, 85% of original)Short text often compresses poorly or grows due to the gzip header. Longer, repetitive text achieves significant savings.
Decompress a gzip stream
H4sIAAAAAAAAA3PP0sivyCxIVAguLilK5XBkBQAQ/wb/EAAAAA==The quick brown fox jumps over the lazy dog.The base64-encoded gzip stream is decoded, decompressed, and the original text is recovered losslessly.
About this tool
Gzip is a widely-used lossless compression format defined in RFC 1952. It wraps the DEFLATE algorithm (a combination of LZ77 and Huffman coding) in a container with a header, optional metadata, and a CRC-32 checksum. The browser's native CompressionStream and DecompressionStream APIs expose gzip compression without any external library.
This tool compresses text to gzip, deflate, or deflate-raw, and decompresses back to text — all in the browser with no server calls. The output is base64-encoded so it can be copied as a string, and the compression ratio and compressed size are shown alongside the result.
How to use
Choose compress or decompress
Pick Compress to gzip/deflate text, or Decompress to decode a compressed byte stream back to text.
Select a format
Choose gzip (with header and checksum), deflate (raw), or deflate-raw. Gzip is the most widely compatible; deflate-raw omits the header.
Read the result
The compressed or decompressed output is shown, along with the size ratio (e.g. '72% smaller') and byte count. Copy the base64 output or download it as a .gz file.
Use cases
Testing gzip compression in a pipeline
Paste a text payload, compress it to gzip, and send it to a server that accepts gzip-encoded request bodies to test compression handling.
Inspecting compressed log files
Decompress a gzip log file stored in a text editor or data tool that doesn't natively read .gz files.
Estimating bandwidth savings
Compress a JSON response body and see the size ratio to estimate how much bandwidth gzip would save in a real HTTP transaction.
Common mistakes
Mistake:Expecting every file to compress well.
Fix:Gzip cannot compress already-compressed data (images, PDFs, other gzip files). It achieves 60–80% reduction on plain text and JSON, but little to none on binary files.
Mistake:Confusing gzip with deflate.
Fix:Gzip adds a 10-byte header and 8-byte footer (CRC) around the DEFLATE data. HTTP servers that advertise 'gzip' support both, but raw deflate without the header may not decompress in all clients.
Mistake:Decoding the base64 output as UTF-8.
Fix:The base64 string represents binary gzip bytes, not text. Decoding it as UTF-8 will produce garbage. Use the decompress function to recover the original text.
Frequently asked questions
Related guides
References & standards
Related tools
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and browse rows in a sortable table with delimiter detection
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV