Skip to tool

LZ4 Compress and Decompress

Compress or decompress LZ4 (.lz4) files up to 2 GiB.

Runs in your browser — your input is processed on this device and never uploaded.

Input

Pasted text up to 100 MiB, read as UTF-8, or a file or folder up to 2 GiB. A folder is packed as a .tar first.

Auto decompresses LZ4 frames and files named .lz4, and compresses anything else. Compress and Decompress force a direction.

Result

Results appear here.

About this tool

On this page

What is LZ4?

LZ4 is a compression format built for speed. It compresses and decompresses much faster than gzip, and the files come out larger in exchange. Files usually end in .lz4.

This tool compresses bytes into an LZ4 frame, or decompresses an LZ4 frame back to the original bytes.

LZ4 options

Input
Pasted text up to 100 MiB, read as UTF-8, or a file up to 2 GiB. A file is read in pieces and is not held whole.
Action
Auto (the default), Compress or Decompress. Auto decompresses LZ4 frames and files named .lz4, and compresses anything else. Decompress reads an LZ4 frame, including the legacy lz4 -l format, and joins several frames written one after another into one output. It does not guess other formats.
Filename
Optional. Compress adds .lz4. Decompress removes one trailing .lz4. Left blank, an upload keeps its own name and pasted text downloads as output.lz4 or output.bin.
  • There is no level setting. This tool always uses the standard fast mode.
  • The result is a file download. Expanding pasted text stops at 200 MiB and expanding a file at 4 GiB. A frame that declares a larger original size is rejected before decoding starts.

Why LZ4 is used so much

When processor time matters more than the last few megabytes, LZ4 is the usual pick. File systems such as ZFS, databases such as ClickHouse, and the Linux kernel use it to compress data as it moves.

In our tests on a desktop computer, 100 MiB of text compressed in about 0.6 seconds and came out at about half its size. Decompressing it took about 0.2 seconds.

LZ4 alternatives

Zstandard (.zst) is a little slower and makes noticeably smaller files. Gzip (.gz) opens almost everywhere. This page opens only LZ4 frames.

The lz4 command's older legacy format (lz4 -l) opens here. Raw LZ4 blocks stored inside another file format do not, because they have no frame header.

The lz4 command on your computer does the same job for files larger than 2 GiB, and it offers slower high-compression levels.

Things to know about LZ4

Yann Collet released LZ4 in 2011. He later created Zstandard.

Warning

An LZ4 frame can carry an xxHash checksum of the original bytes, which catches a damaged or truncated download. It does not tell you who made the file, and it is not a signature.

Browse

Find similar tools by category or tag.