thoughtasylumTOOLBOX Preview

Tools › Encoding

Compress / Decompress

Compress or decompress text, Base64, hex or a file with gzip, zlib or raw deflate, using the browser's own compression.

About this tool What it's for, how to use it and an example

What it's for

Compress data with gzip or zlib, or decompress it, for the times compressed data turns up as text: a SAML request in a URL, a compressed payload in a log or API response, or a .gz file you want to peek inside.

For example, when a single sign-on request arrives as SAMLRequest=fZJNT8Mw…, URL-decode it, paste it here as Base64 with raw deflate, and read the XML inside.

How to use it

Type or paste the input and say what it is: text (read as Base64 when decompressing), Base64 or hex. Choose the Format, or leave it on detect when decompressing: gzip and zlib are recognised by their first bytes, and anything else is tried as raw deflate. Then choose Compress or Decompress.

You can also choose a file, or drop one on the page: one that starts like gzip or zlib is decompressed, anything else is compressed. The result is shown as text when it is text, otherwise as Base64, with the sizes before and after; Save as a file downloads it. Your choices are remembered.

Example

Paste this, with The input is set to Base64 and the format left to detect, and choose Decompress:

H4sIAAAAAAAAA8tIzcnJBwCGphA2BQAAAA==

The result is hello, decompressed as gzip, 25 B → 5 B.

Good to know

gzip, zlib (which the browser calls deflate) and raw deflate are the formats browsers support. ZIP archives, Brotli, bzip2, xz and Zstandard aren’t. Files are read into memory, so very large ones may be slow. Compressing something already compressed, such as a JPEG, makes it slightly bigger.

Compressed results are shown as Base64. A ZIP archive holds files and isn't one of these formats.

Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.

Saved you a few minutes? Say thanks with a coffee.

Something wrong with this tool, or missing from it? Report a bug or suggest a feature.

↑ ↓ move↵ openesc close