Compress text

Compress text with gzip and get the result as a Base64 string that you can copy anywhere. The note shows how much shorter it got.

How it works

  1. Paste your text

    Paste the text, or the code you want to convert back.

  2. Converted straight away

    The tool compresses with gzip and writes the result as Base64 code, or turns such a code back into text.

  3. Copy or download

    You see straight away how much shorter the text has become.

How it works

Your text is compressed with gzip using your browser's built-in compression, then written as Base64 so it stays plain text. Tick URL-safe to use - and _ and drop the = padding, so the result can go straight into a link or a query parameter.

Compression only helps with text of a few hundred characters or more, and works best on repetitive text. A very short text can even get longer, and the note tells you when that happens.

Getting it back

Paste the result into decompress text. Everything happens in your browser; nothing is uploaded. Note that compression isn't encryption; to protect the text with a password, use encrypt text.

Frequently asked questions

Is the compress text free?

Yes. The compress text is completely free, with no account, sign-up or usage limit.

Is any information lost?

No. Gzip is lossless: after decompressing you get exactly the same text back, down to the last space.

Can I open the code without this site?

Yes. It is plain gzip in Base64. On a Mac or Linux, for example, this works: echo "code" | base64 -d | gunzip

Why does my text get longer?

Base64 and the gzip header together take up some space. For short texts that is more than the saving; from a few hundred characters the code gets shorter, especially for text with a lot of repetition.

Is my text stored?

No. Compression happens in your browser; nothing goes to a server.