Gzip / Deflate Inspector

Compress and decompress text with Gzip/Deflate and show size savings (Brotli via wasm).

The Gzip Inspector compresses text or bytes into gzip, zlib or raw deflate, and decompresses data back, showing sizes and ratios. For gzip data it also reads the header fields such as modification time, operating system and CRC-32.

What are gzip, zlib and deflate?

All three use the DEFLATE algorithm (RFC 1951), which combines LZ77 matching of repeated sequences with Huffman coding. They differ only in the wrapper around the compressed stream. Raw deflate has no wrapper. Zlib (RFC 1950) adds a 2-byte header and an Adler-32 checksum. Gzip (RFC 1952) adds a 10-byte header that can hold a file name and timestamp, and ends with a CRC-32 checksum and the original size modulo 2^32. HTTP Content-Encoding: gzip uses the gzip format, while many libraries and file formats embed zlib or raw deflate. Brotli is a different algorithm and is not offered by this tool. Because compressed bytes are not printable text, they are usually shown as Base64 or hex.

How to use Gzip / Deflate Inspector

  1. Pick the operation Choose Compress or Decompress. This resets the algorithm and input format to defaults (gzip and Text for compress, Auto-detect and Base64 for decompress).
  2. Select formats Set Input as, Algorithm and, for compress, Output as (Base64 or Hex) and the Level slider.
  3. Paste your data Type or paste into the input box. The result appears immediately in the output box with summary cards.
  4. Read the cards Compress shows Original, Compressed, Ratio and Saved. Decompress shows Format, Compressed, Decompressed and Ratio, plus header cards for gzip.

Frequently asked questions

Does it support Brotli?

No. Only gzip, zlib and raw deflate are supported.

What is the difference between gzip, zlib and deflate?

They share the same DEFLATE compression and differ in the wrapper. Gzip has a larger header and a CRC-32, zlib has a 2-byte header and an Adler-32 checksum, and raw deflate has neither.

Why does the compressed size sometimes exceed the original?

Very small, random or already compressed data cannot be shrunk, and the wrapper adds bytes. The card then reads Grew by.

What does the CRC-32 in the header tell me?

It is the checksum of the uncompressed data stored in the gzip trailer. The trailer also stores the original size modulo 2^32.

Is there a size limit?

Compression input is limited to 20 MB, and decompressed output larger than 100 MB is rejected.

Is my data sent to a server?

No. Compression and decompression run in the page using the fflate library.