facebook /zstd

Zstandard - Fast real-time compression algorithm

★ 28,216⑂ 2,680
CCreated 2015-01-24www.zstd.net
28,216
stars
+63+63+237
2,680
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

__Zstandard__, or zstd as short version, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level and better compression ratios.
It's backed by a very fast entropy stage, provided by Huff0 and FSE library.

Zstandard's format is stable and documented in RFC8878. Multiple independent implementations are already available.
This repository represents the reference implementation, provided as an open-source dual BSD OR GPLv2 licensed C library,
and a command line utility producing and decoding .zst, .gz, .xz and .lz4 files.
Should your project require another programming language,
a list of known ports and bindings is provided on Zstandard homepage.

Development branch status:

[![Build Status][travisDevBadge]][travisLink]
[![Build status][CircleDevBadge]][CircleLink]
[![Build status][CirrusDevBadge]][CirrusLink]
[![Fuzzing Status][OSSFuzzBadge]][OSSFuzzLink]

[travisDevBadge]: https://api.travis-ci.com/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
[travisLink]: https://travis-ci.com/facebook/zstd
[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite"
[CircleLink]: https://circleci.com/gh/facebook/zstd
[CirrusDevBadge]: https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev
[CirrusLink]: https://cirrus-ci.com/github/facebook/zstd
[OSSFuzzBadge]: https://oss-fuzz-build-logs.storage.googleapis.com/badges/zstd.svg
[OSSFuzzLink]: https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zstd

 Benchmarks

For reference, several fast compression algorithms were tested and compared
on a desktop featuring a Core i7-9700K CPU @ 4.9GHz
and running Ubuntu 24.04 (Linux 6.8.0-53-generic),
using [lzbench], an open-source in-memory benchmark by @inikep
compiled with [gcc] 14.2.0,
on the [Silesia compression corpus].

[lzbench]: https://github.com/inikep/lzbench
[Silesia compression corpus]: https://sun.aei.polsl.pl//~sdeor/index.php?page=silesia
[gcc]: https://gcc.gnu.org/

| Compressor name         | Ratio | Compression| Decompress.|
| ---------------         | ------| -----------| ---------- |
| zstd 1.5.7 -1       | 2.896 |   510 MB/s |  1550 MB/s |
| brotli 1.1.0 -1         | 2.883 |   290 MB/s |   425 MB/s |
| [zlib] 1.3.1 -1         | 2.743 |   105 MB/s |   390 MB/s |
| zstd 1.5.7 --fast=1 | 2.439 |   545 MB/s |  1850 MB/s |
| quicklz 1.5.0 -1        | 2.238 |   520 MB/s |   750 MB/s |
| zstd 1.5.7 --fast=4 | 2.146 |   665 MB/s |  2050 MB/s |
| lzo1x 2.10 -1           | 2.106 |   650 MB/s |   780 MB/s |
| [lz4] 1.10.0            | 2.101 |   675 MB/s |  3850 MB/s |
| snappy 1.2.1            | 2.089 |   520 MB/s |  1500 MB/s |
| lzf 3.6 -1              | 2.077 |   410 MB/s |   820 MB/s |

[zlib]: https://www.zlib.net/
[lz4]: https://lz4.github.io/lz4/

The negative compression levels, specified with --fast=,
offer faster compression and decompression speed
at the cost of compression ratio.

Zstd can also offer stronger compression r

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON