Extremely fast lossless compression algorithm in C, with a very fast decoder and a tunable speed-versus-ratio trade-off.
meta/zstd
Zstandard (zstd) is a fast lossless compression algorithm and command-line tool with a C reference library.
Open-source alternative to:gzip
- Stars
- 28,196
- Forks
- 2,677
- Open issues
- 440
- Last commit
- 18 hours ago
What is it?
Zstandard, or zstd, is a lossless compression algorithm aimed at real-time use. It reaches zlib-level or better compression ratios while running much faster, and its entropy stage is built on the Huff0 and FSE libraries. The format is standardized in RFC 8878, and this repository is the reference implementation.
The project provides an open-source C library (libzstd) and a command-line utility that creates and decodes .zst files, and also handles .gz, .xz and .lz4 files. Compression speed can be traded against ratio in small steps, and decompression speed stays roughly constant across settings. Ports and bindings for other languages are listed on the project homepage.
For small data, zstd includes a training mode that builds a dictionary from sample files. Loading that dictionary before compression and decompression substantially improves the ratio on small records. The build can be driven by make, CMake, Meson, Bazel, vcpkg or Conan.
Key features
- 01Lossless compression with zlib-level or better ratios at higher speed
- 02Compression level tuning from fast modes to high-ratio modes
- 03Dictionary training to improve compression of small data
- 04Command-line tool that also handles .gz, .xz and .lz4 files
- 05C library with a stable, RFC 8878-documented format
- 06Multiple build systems including make, CMake, Meson, Bazel and vcpkg
Use cases
- Compressing large files or data streams where speed matters
- Compressing many small records by training a shared dictionary
- Embedding a fast compression library in C or C++ applications
- Replacing gzip in scripts to get better speed or ratio
Quick start
- 1
Build the zstd CLI and libzstd library with make
make - 2
Run the local smoke tests
make check - 3
Install the CLI, library and man pages
make install
Things to know
- The project is dual-licensed under BSD or GPLv2, so the GPLv2 option carries copyleft obligations.
- The repository's license metadata reads NOASSERTION, so check the LICENSE and COPYING files directly.
In collections
Topics
FAQ
- What is zstd?
- Zstandard (zstd) is a fast lossless compression algorithm and command-line tool with a C reference library. Zstandard, or zstd, is a lossless compression algorithm aimed at real-time use. It reaches zlib-level or better compression ratios while running much faster, and its entropy stage is built on the Huff0 and FSE libraries. The format is standardized in RFC 8878, and this repository is the reference implementation.
- Is zstd free to use? What license does it have?
- zstd is open source under the Other license. Check the license terms before using it in commercial products.
- Is zstd still maintained?
- Actively maintained. The last commit to zstd was on Nov 7, 2026.
- What can I use zstd for?
- Compressing large files or data streams where speed matters Compressing many small records by training a shared dictionary Embedding a fast compression library in C or C++ applications Replacing gzip in scripts to get better speed or ratio
- How do I install zstd?
- Build the zstd CLI and libzstd library with make: make Run the local smoke tests: make check Install the CLI, library and man pages: make install
- Where can I get zstd?
- The source code and installation instructions are on GitHub: https://github.com/meta/zstd
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Multithreaded lossless PNG and APNG optimizer written in Rust, usable as a command-line tool or a Rust library.
A terminal CLI for compressing, decompressing and listing archives in many formats, with format detection from file extensions.
A tool for creating isolated Python virtual environments so each project can keep its own set of packages.
Deduplicating backup program with optional compression and authenticated encryption, storing only changed chunks of data.
A cross-platform FFmpeg GUI for lossless cutting, trimming and remuxing of video and audio files without re-encoding.