Gzip / Deflate / Brotli.
Compress or decompress text and files with gzip, zlib deflate and raw deflate (Brotli where supported).
Runs in your browserAbout Gzip / Deflate / Brotli
This tool compresses and decompresses data with the algorithms behind HTTP Content-Encoding, .gz files, zlib and PNG. Paste text to compress it with gzip, zlib deflate or raw deflate and get the result as Base64 or hex plus a downloadable file, or paste a Base64 or hex payload (or drop a .gz file) to see what is inside. When decompressing with format set to auto, the tool recognises gzip by its 1f 8b header and zlib by its two-byte header and falls back to raw deflate, so you rarely need to know which variant a service used. The details panel shows input and output sizes and the compression ratio. Typical uses are reading a gzipped, Base64-encoded field from a log or a webhook, checking how well a JSON response compresses, inflating a SAML redirect or a compressed JWT claim, and producing test fixtures. A frequent mix-up is deflate itself: HTTP "deflate" and zlib mean the zlib-wrapped format, while raw deflate has no header and no checksum; pick deflate-raw for PHP gzdeflate() output or SAML. Short inputs can get bigger after compression because gzip adds about 18 bytes of header and trailer. Brotli is listed but depends on your browser: the tool uses the browser's built-in CompressionStream, and most browsers do not offer Brotli there, in which case you get a clear message instead of a fake result. The emaeglin.dev iOS app uses Apple's Compression framework for this tool. Output is capped at 64 MB to protect against zip bombs. Nothing is uploaded.
How to Use
- Choose compress or decompress and the format (auto works for most inputs).
- Paste text or Base64/hex, or drop a file.
- Copy the result or download the compressed or decompressed file.
Frequently Asked Questions
What is the difference between gzip, deflate and deflate-raw?
All three use the same DEFLATE compression. gzip adds a 10-byte header and a CRC-32 trailer, zlib (called deflate in HTTP) adds a 2-byte header and an Adler-32 checksum, and raw deflate has no wrapper at all.
Why is Brotli not working?
The tool relies on the browser's CompressionStream API, and most browsers do not support Brotli in it. When yours does not, the tool says so instead of guessing; use gzip or deflate, or the iOS app.
Why did my text get bigger after compression?
Very short inputs have little redundancy, and gzip adds about 18 bytes of framing. Compression pays off from a few hundred bytes upwards.
Is my data uploaded?
No. Compression runs in your browser using its built-in streams.
Related Tools
Encode and decode Base64 strings.
Encode any file to Base64 or a data URI, with URL-safe and MIME line-wrapping options.
Decode SAMLRequest and SAMLResponse values (redirect or POST binding) into readable XML and key fields.
Compress PNG and JPEG images with adjustable quality.
Convert text to hexadecimal bytes and hex dumps back to UTF-8 text.
Decode, inspect, and verify JSON Web Tokens.