Gzip Compress / Decompress
Compress text or files with gzip, zlib or raw deflate; decode Base64 or hex and inspect gzip headers.
How to use
- Select Compress or Decompress, then choose gzip, deflate (zlib), or deflate-raw. Match the format used by your data; these wrappers are not interchangeable.
- Type UTF-8 text, paste compressed Base64 or hex, or drop a local file. Sample fills input for the current mode and format. Results update automatically.
- Copy the encoded output or download binary bytes. For non-UTF-8 output, select Hex. Gzip decompression also shows header and trailer fields.
- Input and decompressed output are capped at 20 MB each. The browser chooses the compression level. Use a single gzip member.
FAQ
How is gzip different from deflate and zlib?
All three formats here use DEFLATE compression. Gzip adds its own header and a CRC32 / original-size trailer. The deflate option uses a zlib wrapper with Adler-32. Deflate-raw contains only the compressed stream. Select the exact format your producer used; .gz is not a ZIP archive.
Can I choose a gzip compression level?
No. CompressionStream does not expose a compression-level option. Small inputs can become larger because of framing overhead. The ratio is compressed bytes divided by original bytes, not the size of the Base64 or hex text.
Why does gunzip return an invalid UTF-8 error?
A gzip member may contain any binary data, not just text. This tool rejects lossy text decoding and offers a hex view and binary download instead. A format or checksum error is different: it means the stream could not be decompressed correctly.
Does converting a file to Base64 compress it?
No. Base64 only represents bytes as text and usually increases size. This tool compresses the bytes first, then encodes them for copying. Use the related Base64 File Converter when you only need encoding. All processing stays local; only options are persisted, never input or files.