Gzip Text Compressor
Compress text to a base64-encoded gzip string, or decompress one back to plain text, entirely in your browser.
How this tool works
Choose compress or decompress
Compress plain text to base64 gzip, or decompress a base64 gzip string back to text.
Paste your input
Any text block for compression, or a base64 string for decompression.
Run the operation
The browser's native CompressionStream/DecompressionStream API does the real gzip work.
Compare sizes and copy
Before/after byte sizes and percentage reduction are shown alongside the result.
Quick facts
- Category
- Encoders & Decoders
- Best for
- Checking how compressible a text payload is, or producing a compact string for a size-limited field
About this tool
Compress any block of text using real gzip compression and get back a base64-encoded string safe to paste into JSON, a URL, or an email - or run it in reverse, pasting a base64 gzip string to recover the original text. This uses the browser's native CompressionStream and DecompressionStream APIs (widely supported in current Chrome, Firefox, Safari, and Edge) rather than a bundled compression library, so the same real DEFLATE-based gzip algorithm used by servers and command-line gzip runs directly in JavaScript with no dependency download. Before and after sizes are shown together with the percentage reduction, the same way the image compressor reports its savings, so you can see exactly how much a given block of text - repetitive log output, a large JSON blob, or plain prose - actually shrinks. Useful for testing how compressible a payload is before deciding whether to gzip it server-side, or for producing a compact string to embed somewhere space is limited. Runs entirely client-side; nothing is uploaded.
Why use this tool
Real gzip, no dependency
Uses the browser's built-in CompressionStream API - the same DEFLATE-based gzip format servers use.
Runs entirely client-side
Text is compressed or decompressed locally; nothing is uploaded to a server.
Transport-safe output
Compressed output is base64-encoded, safe to paste into JSON, a URL, or plain text fields.
Before/after size comparison
See the exact byte counts and percentage saved, the same way the image compressor reports savings.
Frequently asked questions
Yes - CompressionStream('gzip') implements the standard gzip container format (RFC 1952) around DEFLATE compression, the same format produced by server-side gzip compression and the Unix gzip utility. A file compressed here would decompress correctly with those tools too, though this tool's output is additionally base64-encoded for safe copy-pasting as text.
Gzip has fixed overhead for its header, footer, and compression tables, plus base64 encoding itself expands data by roughly a third - for very short or already-random-looking text, that overhead can outweigh the savings from compression. Gzip performs best on longer, more repetitive text, where the savings from finding repeated patterns outweigh the fixed overhead.
CompressionStream and DecompressionStream are supported in current versions of Chrome, Edge, Firefox, and Safari, but the tool checks for their presence and shows a clear message instead of failing silently if they're unavailable - this can happen on an older browser version that predates the API.
Explore more free tools
Formatters, converters, validators, and generators - all free and running entirely in your browser.
Browse more tools