Gzip Compress

Gzip text to Base64, or decompress a Base64 gzip payload back to text.

Smaller text, still text on screen

Gzip is a byte compression. This page compresses text to a Base64 string you can paste, or expands that Base64 back to text. Nothing is uploaded. Ordinary Base64 without compression is Base64.

How to use it

  1. Paste the text, or a Base64 gzip string.
  2. Mode is Compress or Decompress.
  3. Convert runs it. Show Example sets Compress and the word hello. The result is Base64, not the word hello. Paste that result, switch Mode to Decompress, and Convert again to get hello back.
  4. Clear All empties both boxes. Copy Result copies the output. This page does not update as you type, because compression finishes asynchronously.

What the bytes are

Compress encodes the text as UTF-8, gzips those bytes, then Base64-encodes them. Decompress expects standard Base64 of a gzip stream and decodes the bytes as UTF-8. Broken Base64 uses the Base64 error. Bytes that are not gzip use the gzip error. The browser has to provide gzip streams. An older browser says it cannot gzip. The output is not a .gz file download.

Where people use it

  • Shrinking a snippet to paste into a ticket.
  • Checking that a Base64 blob is gzip of a known sentence.
  • Round-tripping text without a command line.

Questions

The compressed text is longer than hello.

Gzip has a header. A very short string can grow. Longer text is where it shrinks.

Decompress failed on a .gz I opened as text.

Paste the Base64 of the gzip bytes, not the raw binary opened in a text box.