Gzip Compress (Base64)

Compress text with gzip, deflate or raw deflate and copy the result as Base64. It is handy for checking how well a payload compresses or producing test data.

Use the tool

Why this tool exists

Compressed payloads turn up in API requests, message queues, cookies, URLs and test fixtures, and you often want to produce one quickly: to check how many bytes gzip really saves on a JSON sample, or to create a Base64 blob that a decoder can read.

This tool uses the compression streams built into modern browsers, so the output is standard data that other software can read. Pick gzip for files and HTTP, deflate for the zlib wrapper, or deflate-raw for protocols that supply their own headers. The text is compressed locally and never uploaded.

How to use it

  1. Paste the text you want to compress into the box.
  2. Choose a format: gzip, deflate or deflate-raw.
  3. Read the Base64 output.
  4. Copy it, or paste it into the Gzip Decompress tool to check the round trip.

Frequently asked questions

Which format should I choose?

Use gzip for .gz files and HTTP Content-Encoding. Use deflate for the zlib-wrapped format, and deflate-raw for formats such as ZIP entries that carry no header. The decompress tool needs the same format to read the data back.

Why is my output bigger than the input?

Very short or already compressed text can grow, since headers and the Base64 step add overhead of roughly a third. Compression pays off on longer, repetitive text such as JSON, HTML or logs.

Is the result identical to the gzip command?

It is valid gzip that any decoder reads, but the bytes may differ from command-line output because header fields, compression level and implementation vary between programs.

Does it work in every browser?

It needs the CompressionStream feature, which current versions of Chrome, Edge, Firefox and Safari provide. In an older browser the tool reports an error instead of producing output.