gzip | compress | decompress

> gzip | compress | decompress <

Compress text or files with gzip and get Base64 or hex output, or paste gzip data to decompress it. Uses your browser's native compression, nothing is uploaded.

[01]

Native & Private

Uses the CompressionStream API built into your browser. Your text and files never leave your device.

[02]

Text or Files

Compress typed text or pick a file, then copy the result as Base64 or hex or download the compressed bytes.

[03]

Size Report

See original and compressed sizes with the compression ratio so you know exactly what you saved.

// GZIP TECHNICAL INFO

How It Works:

Gzip wraps DEFLATE-compressed data in a small container: a 10-byte header (magic bytes 1F 8B, method, flags, timestamp, OS), the DEFLATE stream, and a trailer holding a CRC-32 checksum and the original size. DEFLATE itself combines LZ77 back-references with Huffman coding.

Example:

Text "aaaaaaaaaa" → 1F 8B 08 00 ... (starts with the gzip magic bytes)

Why Use This Tool:

  • >Shrink JSON, logs and HTML before storing or sending them
  • >Inspect the contents of gzip payloads from APIs, headers and databases
  • >Check what Content-Encoding: gzip will do to a response size
  • >Generate gzip test fixtures for unit tests

>> frequently asked questions

Q: What is gzip?

A: Gzip is a widely used lossless compression format defined in RFC 1952. It wraps a DEFLATE stream with a header and a CRC-32 checksum and is the default way web servers compress HTML, CSS, JavaScript and JSON responses (Content-Encoding: gzip).

Q: How do I compress text with gzip online?

A: Type or paste text into the input box with COMPRESS selected. The tool gzips the UTF-8 bytes and shows the result as Base64 or hex, along with the original and compressed size. You can also choose a file instead of typing text and download the result as a .gz file.

Q: How do I decompress gzip data?

A: Switch to DECOMPRESS, choose the same encoding the data is in (Base64 or hex), and paste it. If the result is valid UTF-8 text you see it directly; binary results are shown as hex.

Q: What is the difference between gzip, zlib and raw deflate?

A: All three use the DEFLATE algorithm. Raw deflate is the bare stream, zlib adds a 2-byte header and an Adler-32 checksum (RFC 1950), and gzip adds a 10-byte header and a CRC-32 checksum (RFC 1952). The same data compressed in each format differs only in these wrappers.

Q: How can I recognise gzip data?

A: Gzip streams always start with the bytes 1F 8B (H4sI in Base64). If your Base64 string begins with "H4sI", it is almost certainly gzip data.

Q: Why is my compressed output larger than the input?

A: Very short or already-compressed inputs (images, zip files, encrypted data) cannot be shrunk and the gzip header and trailer add about 18 bytes. Compression pays off on repetitive text such as JSON, HTML and logs.

Q: Is it safe to paste sensitive data?

A: Yes. Compression uses the CompressionStream API built into your browser, so nothing is sent to a server.

// OTHER LANGUAGES

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Decompress page output in Node and Node output in the page, checking exact bytes.
Comparison reference
Interoperability between browser CompressionStream / DecompressionStream and Node.js zlib.
Verification scope
These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.