HomeAll toolsGzip / LZ4

Gzip / LZ4

Compress and decompress text or files with Gzip and LZ4 — or paste Base64 and hex bytes and get plain text back in one step.

Data is processed only in your browser
Text / UTF-8
Result

How to use

Gzip / LZ4 provides online compression and decompression with two mainstream algorithms. Gzip offers high compression ratios and broad compatibility — it's the most widely used compression format. LZ4 is extremely fast, ideal for performance-critical real-time scenarios.

How to use: To compress, paste text into the input field or click "File Import" — the result is Base64, or hex if you switch the format tab. To decompress, just paste the Base64 or hex bytes from an API response and press Run: when the payload opens with the GZIP (1f 8b) or LZ4 frame (04 22 4d 18) signature, the tool recognises the codec, flips to Decompress and returns the plain text, so you never have to pre-select a tab.

Gzip vs LZ4 Algorithm Comparison

FeatureGzipLZ4
Compression ratio60%-80% (high)40%-60% (moderate)
Compression speedModerate (~50 MB/s)Very fast (~500 MB/s)
Decompression speedModerate (~150 MB/s)Very fast (~1500 MB/s)
CPU usageModerateLow
Best forFile archiving, HTTP transferReal-time communication, memory cache
Format standardRFC 1952Custom format

Use Cases

HTTP response compression: Web servers use Gzip to compress HTML/CSS/JS files, reducing transfer size by 70%+. Enable with gzip on; in Nginx.

Log storage optimization: Compress daily log files with Gzip for storage to save disk space. LZ4 is better suited for hot data that needs frequent read/write access.

Troubleshooting

Decompression fails? Framed Gzip and LZ4 are recognised on their own, so the algorithm tab does not have to match first. When nothing is recognised, the payload is usually an LZ4 block with no frame header or raw deflate — neither carries a signature, so neither can be detected from its bytes and both need a command-line decoder.

Compressed size is larger? For already-compressed data (images, videos) or very short text, the algorithm may not reduce size and may even add header overhead.

Frequently asked questions

What's the difference between Gzip and LZ4?

Gzip offers higher compression ratios but is slower, ideal for archiving and transfers. LZ4 is extremely fast with lower compression, suited for real-time scenarios. Use both to compare.

Can it compress binary files?

Yes. Switch the mode to File and upload one file (up to 20 MB) — the tool works on the raw bytes, for both Gzip and LZ4, compress and decompress.

Can I download the compressed data?

Yes. In File mode the result downloads as binary with a .gz or .lz4 extension; a decompressed result downloads as .bin, because the original file name cannot be recovered from the bytes. In Text mode the result is Base64 — or hex, if you switch the format tab — that you can copy.

Can I paste Base64 gzip from an API response?

Yes. Paste it and press Run: the tool reads the GZIP (1f 8b) or LZ4 frame (04 22 4d 18) signature from the first bytes, switches to Decompress and returns the plain text, so you do not choose a codec or a direction first. Use the Hex tab to paste hex bytes instead. Everything runs locally and nothing is uploaded.

See all questions

Go deeper

Related tools