DEFLATE Compress & Decompress
Compress and decompress text or a file with raw DEFLATE or zlib framing — the algorithm underneath GZIP, ZIP and PNG.
Input
Output (Base64)
Compressing in the browser
Compression runs through the platform’s CompressionStream API — the same implementation the browser uses to decode gzipped responses — so there is no library to download and nothing is uploaded.
Compressed output is binary, so it is shown as Base64. That is the only form that survives being copied out of a text box and pasted somewhere else intact.
- gzip — with headers and a CRC-32; what a web server sends and what a .gz file contains.
- deflate — the zlib-wrapped stream.
- deflate-raw — the bare DEFLATE stream, with no wrapper at all.
Frequently asked questions
Why did my short text get larger?
gzip adds about 20 bytes of header and checksum. For anything under roughly 100 bytes that overhead outweighs the compression.
Why is Brotli not offered?
Browsers can decompress Brotli for HTTP responses but do not expose it to pages. Offering it would mean shipping a WebAssembly build larger than the rest of the site.
Can I decompress a .gz file?
This page works on text. Paste the Base64 form of the file, or use it to check a payload from an API rather than a file from disk.