What Is a .ZST File?
Zstandard compressed data
Zstandard Compressed File (.zst)
Overview
Zstandard (zstd) is a lossless compression algorithm and file format developed by Yann Collet at Facebook and released in 2016. A .zst file is a single stream of Zstandard-compressed data, in the same way a .gz file is a gzip stream: it compresses one file, and archives of many files are .tar.zst.
Zstandard's appeal is the trade-off it offers. At its default level it compresses about as well as zlib while decompressing three to five times faster; at high levels it approaches xz's ratio at a fraction of the time. That combination made it the default in a remarkable number of places in under a decade: Linux kernel modules and initramfs, Arch and Fedora packages, Btrfs and ZFS transparent compression, PyTorch and Parquet, and the --zstd option in tar, rsync and git.
Technical Specifications
- MIME Type:
application/zstd - File Extensions:
.zst;.tzstor.tar.zstfor tarballs - Category: Archive
- Specification: RFC 8878
- Algorithm: LZ77-style matching with finite state entropy (tANS) and Huffman coding
- Levels: 1 to 19 normally, 20 to 22 with
--ultra; negative levels for extreme speed - Released: August 2016
- Licence: BSD and GPLv2, dual
- Magic bytes:
28 B5 2F FD
Identification
00000000 28 b5 2f fd 64 00 00 ... |(./.d...|
Every Zstandard frame begins with 28 B5 2F FD. A file may contain several frames back to back. Skippable frames, used for metadata and seek tables, begin 50 2A 4D 18 through 5F 2A 4D 18 and decoders ignore them.
File Structure
Zstandard frame
├── Magic number 28 B5 2F FD
├── Frame header 2 to 14 bytes: content size, window size, dictionary id, checksum flag
├── Data blocks each with a 3-byte header: last-block flag, type (raw / RLE / compressed), size
└── Content checksum optional 4-byte XXH64 fragment
Blocks are at most 128 KB. The window size in the header tells the decoder how much memory it needs, which is why a file compressed with --long at a huge window may refuse to decompress on a small device unless the same flag is given.
Dictionaries
Zstandard can be trained on a sample of similar small files to produce a dictionary that dramatically improves compression of that kind of data (log lines, JSON records, protocol messages). A .zst file compressed with a dictionary records the dictionary id and cannot be decompressed without it, which occasionally surprises people handling files from a database or message queue.
History and Development
Collet, who had earlier written LZ4, designed Zstandard to fill the gap between LZ4's speed and xz's ratio. Facebook open-sourced it in 2016 and uses it across its infrastructure. The IETF published the format as RFC 8478 in 2018 and the revised RFC 8878 in 2021.
Adoption milestones: Linux 5.9 gained zstd kernel image compression (2020); Fedora switched RPM payloads to it (2019) and Arch its packages (2020); Ubuntu and Debian's apt and dpkg added support; Chrome and Firefox added Content-Encoding: zstd for HTTP (2024); Microsoft added it to Windows 11's built-in archive support (2023).
Common Use Cases
- Package managers: Arch, Fedora, openSUSE and others store packages as
.tar.zstor zstd-compressed payloads - Linux kernel and initramfs compression
- Filesystems: Btrfs and ZFS use zstd for transparent compression
- Backups and snapshots:
tar --zstd, Borg, restic and ZFS send streams - Data engineering: Parquet, ORC, Arrow and Kafka all offer zstd as a codec
- HTTP compression for responses to modern browsers
- Game assets and databases (RocksDB, MongoDB WiredTiger)
How to Open a ZST File
Linux and macOS
The zstd package provides the tool; it is in every distribution's repositories and in Homebrew:
# Decompress to the same name without .zst
zstd -d file.zst
unzstd file.zst # same thing
# To standard output, for piping
zstdcat file.zst | less
# A tarball, in one step
tar --zstd -xf archive.tar.zst
tar -xf archive.tar.zst # modern tar detects it from the magic bytes
# Inspect without extracting
zstd -l archive.tar.zst
Windows
- Windows 11 (23H2 and later): File Explorer opens
.zstand.tar.zstnatively; right-click, Extract All. - 7-Zip 21.07 and later support zstd through the 7-Zip-Zstandard fork or built-in in recent versions; PeaZip and NanaZip support it fully.
- The official
zstd.exefrom the project's GitHub releases works in PowerShell exactly as above.
Graphical, any platform
- 7-Zip, PeaZip (Windows and Linux), Keka and The Unarchiver (macOS), File Roller and Ark (Linux).
In code
import zstandard as zstd # pip install zstandard
with open("data.zst", "rb") as f, open("data", "wb") as out:
zstd.ZstdDecompressor().copy_stream(f, out)
Node (@mongodb-js/zstd, fzstd), Go (klauspost/compress), Rust (zstd crate), Java (zstd-jni) and most other languages have bindings; Python 3.14 added compression.zstd to the standard library.
How to Create and Convert ZST Files
# Compress a file (level 3 default); keeps the original
zstd file
# Higher compression, remove the original
zstd -19 --rm file
# Fastest useful setting, multi-threaded
zstd -1 -T0 largefile
# Long-range matching for very large, repetitive inputs
zstd --long=27 -T0 backup.img
# Tarball
tar --zstd -cf archive.tar.zst folder/
# Convert from gzip or xz without an intermediate file
gzip -dc old.tar.gz | zstd -o new.tar.zst
xz -dc old.tar.xz | zstd -19 -o new.tar.zst
Choosing a level: 1 to 3 for speed-critical paths, 3 (default) for general use, 9 to 12 for a good balance when compressing once and reading often, 19 for distribution where every byte counts. Decompression speed barely changes with level, which is the property that makes high levels practical.
Advantages
- Very fast decompression at every level.
- Wide range: one tool spans LZ4-like speed to xz-like ratio.
- Multi-threaded compression built in (
-T0). - Dictionary mode for small records.
- Standardised (RFC 8878) and ubiquitous in modern systems.
Limitations
- Single stream:
.zstholds one file; use tar for directories. - Not universal on older systems: Windows 10 and older macOS need a tool installed.
- Dictionary-compressed files need the dictionary.
- Slightly behind xz at maximum ratio, for workloads where time is free.
Related Formats
How to identify .ZST files from the bytes
Zstandard compressed data files carry a fixed byte pattern, the file signature or magic number, that identifies them regardless of the extension. This is what our detector reads.
| Offset | Hex | ASCII |
|---|---|---|
| 0 | 28 B5 2F FDZstandard frame magic. Skippable frames use 50 2A 4D 18 through 5F 2A 4D 18. |
Check a file yourself: xxd -l 16 file.zst on macOS and Linux, or Format-Hex file.zst | Select-Object -First 1 in PowerShell.Full ZST signature reference
File Information
Zstandard compressed data
Archive
.zst
application/zstd
Related File Types
Other file types in the Archive category you might also need:
Related reading
Start Analyzing ZST Files Now
Use our free AI-powered tool to detect and analyze Zstandard compressed data files instantly with Google's Magika technology.
⚡Try File Detection Tool