Gzip / deflate decoder
Decompress gzip, zlib or raw deflate data pasted as base64 or hex, or from a file, with the format detected, and compress text or files the same way. Runs in your browser.
Decompress
- Paste base64 (standard or URL-safe) or hex, or open a file. The input encoding is detected.
- The format is detected from the first bytes: gzip starts with
1f 8b(H4sIin base64), zlib with a two-byte header such as78 9c(eJin base64), and anything else is tried as raw deflate. You can also pick the format yourself. - For gzip, the header is shown: the original file name, modification time, the operating system it was made on, any comment, and the uncompressed size from the trailer.
- Text output is shown as text, and JSON is pretty-printed. Binary output is shown as a hex dump. You can download either.
Compress
Compress text or a file to gzip, zlib or raw deflate and get the result as base64 and hex, or download it as a .gz file. Sizes before and after are shown.
gzip, zlib and deflate
- Deflate (RFC 1951) is the compression itself. Raw deflate has no header or checksum; the SAML HTTP-Redirect binding and ZIP files use it.
- zlib (RFC 1950) wraps deflate in a 2-byte header and an Adler-32 checksum.
Content-Encoding: deflatein HTTP means zlib, though some servers send raw deflate instead. - gzip (RFC 1952) wraps deflate in a header with a file name and time, and a CRC-32 and size trailer. It is used for
.gzfiles andContent-Encoding: gzip.
Questions
- Why does it say the data is truncated?
- The compressed stream ends before its end marker, so part of the data is missing. This usually means a copy-paste was cut short or a download stopped early.
- Can it decompress Brotli or zstd?
- No. Browsers can only decompress gzip, zlib and deflate in a page. Zstandard data starts with
28 b5 2f fdand is reported as such; Brotli (Content-Encoding: br) has no signature, so it shows up as data that is not compressed in any supported format. Usebrotli -dorzstd -dinstead. - Why is my compressed output different from gzip on the command line?
- Compressors can encode the same data in different ways depending on the level and implementation, and gzip also records a time and file name. Any decompressor still gets back exactly the same data.
- Is my data uploaded?
- No. Compression and decompression run in your browser, and files never leave your device.