LZ4 is a lossless compression algorithm designed to minimise the time required to compress and decompress data. Its emphasis on speed makes it particularly suitable for workloads where compression must introduce very little processing overhead.
The algorithm belongs to the LZ77 family and uses a compact, byte-oriented block format. The project also defines a framed format for files and streams, allowing applications to exchange compressed data without relying on a proprietary container.
LZ4 provides a reference library and command-line tool. Its applications range from filesystem and database compression to game assets, caches and data transmission. Developers can choose between rapid compression and stronger compression while retaining fast decompression.
This is free and open source software.
Key Features
- Extremely fast compression and decompression of lossless data.
- Standard block and frame formats for interoperability between applications.
- LZ4_HC mode trades additional compression time for improved compression ratios.
- Adjustable acceleration allows compression speed to be prioritised over density.
- Dictionary compression through the library API and command-line utility.
- Can use a supplied file as a compression dictionary, considering its final 64KB.
- Supports streaming compression and decompression of large datasets.
- Provides one-shot compression functions for processing complete data buffers.
- Offers advanced functions that reuse compression contexts.
- Includes a command-line utility for working with compressed files and streams.
- Provides checksums and other metadata through the framed format.
- Offers a C library suitable for integration into other applications.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: lz4.github.io/lz4
Support:
Developer: Yann Collet
License: BSD 2-Clause ‘Simplified’ License
LZ4 is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| Compression Tools | |
|---|---|
| LZ4 | Focused on compression and decompression speed |
| Zstandard | Fast compression algorithm, providing high compression ratios |
| brotli | Generic-purpose lossless compression algorithm |
| lzop | File compressor favoring speed over compression ratio |
| pigz | Parallel implementation of gzip |
| ouch | CLI tool for compressing and decompressing for various formats |
| pixz | Parallel, indexed xz compressor |
| gzip | Provides the standard GNU file compression utilities |
| BZip3 | Spiritual successor to BZip2 |
| bzip2 | Freely available, patent free, high-quality data compressor |
| PBZIP2 | Parallel implementation of bzip2 |
| lrzip | Achieve very high compression ratios and speed when used with large files |
| lbzip2 | Multi-threaded implementation of bzip2, suited for serial and parallel processing |
| ZXC | High-performance lossless compression library and command-line tool |
| plzip | Massively parallel lossless data compressor |
| p7zip-zstd | p7zip fork with additional codecs and improvements |
| 7-Zip | File archiver with a high compression ratio |
| ncompress | Fast, simple LZW file compressor |
| PXZ | Runs LZMA compression on multiple cores and processors |
| crabz | Like pigz but written in Rust |
| Lzip | Lossless data compressor aimed at Unix-like systems |
| cmix | Optimize compression ratio at the cost of high CPU/memory usage |
| bsc | High-performance block-sorting compressor for large files |
| rapidgzip | Parallelized decompression of gzip files |
| Kanzi | Modular lossless compressor with multithreaded processing |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.