.ZST Zstandard Compressed
.zst

Zstandard Compressed

Zstandard (zstd) is a fast lossless compression algorithm developed by Yann Collet at Meta in 2015. It achieves compression ratios comparable to gzip while being significantly faster at both compression and decompression, with 22 adjustable compression levels.

Archive structure
Header magic bytes
Entries compressed files
Index directory
ArchiveLZ77 + FSELevels 1-22RFC 84782015
By FileDex
Not convertible

Zstandard decompression requires libzstd not available in browser WASM.

Common questions

How do I open or inspect a ZST file?

Use zstd -dk file.zst to decompress while keeping the original, or zstdcat file.zst | head to preview content. On Windows, recent versions of 7-Zip support .zst files. Use zstd -l file.zst to view compression stats.

What compression level should I use with zstd?

Level 3 (default) balances speed and ratio for most workloads. Levels 1-4 are speed-optimized. Levels 15-19 are ratio-optimized. Levels 20-22 are ultra mode for maximum compression with significantly slower speed.

What is dictionary compression in Zstandard?

Dictionary compression pre-trains a model on representative sample data, allowing zstd to achieve high compression ratios even on small files (under 4 KB) where LZ77 cannot build sufficient context. Both compressor and decompressor must share the same dictionary.

Why are Linux distributions switching to zstd?

Zstandard packages decompress 5-10x faster than xz packages with only slightly larger file sizes. For package managers that extract thousands of files per update, the decompression speed gain significantly reduces install time.

What makes .ZST special

What is a ZST file?

Zstandard (zstd) is a fast lossless compression algorithm developed by Yann Collet at Meta. It provides compression ratios comparable to zlib while being significantly faster at both compression and decompression. Zstandard has been adopted by major systems including Linux kernel, PostgreSQL, and package managers.

Continue reading — full technical deep dive

How to open ZST files

  • 7-Zip (Windows) — Free, recent versions support zstd
  • zstd CLI (Windows, macOS, Linux) — zstd -d file.zst
  • tar (Linux) — tar --zstd -xf archive.tar.zst
  • PeaZip (Windows, Linux) — Free GUI

Technical specifications

Property Value
Algorithm Zstandard (LZ77 + FSE)
Compression Levels 1-22 (configurable)
Speed 400-500 MB/s compression, 1+ GB/s decompression
Dictionary Trainable dictionaries for small data
Standard RFC 8478, RFC 8878

Common use cases

  • Package managers: Arch Linux pacman, Fedora RPMs use zstd.
  • Databases: PostgreSQL and RocksDB compression.
  • Filesystem: Btrfs transparent compression.
  • Networking: HTTP content encoding.

.ZST compared to alternatives

.ZST compared to alternative formats
Formats Criteria Winner
.ZST vs .GZ
Speed
Zstandard compresses 3-5x faster and decompresses 2-3x faster than gzip at comparable compression ratios. At level 3, zstd matches gzip -9 ratio while compressing 10x faster.
ZST wins
.ZST vs .GZ
Compression ratio
At level 19+, Zstandard exceeds gzip's maximum compression. At level 3, it matches gzip -9 output size. Gzip has no equivalent to zstd's high levels.
ZST wins
.ZST vs .LZ4
Compression ratio
Zstandard at level 1 already compresses better than LZ4 while maintaining comparable decompression speed. At higher levels, zstd far exceeds LZ4 ratios.
ZST wins

Technical reference

MIME Type
application/zstd
Magic Bytes
28 B5 2F FD Zstandard magic number.
Developer
Yann Collet / Meta
Year Introduced
2016
Open Standard
Yes — View specification
0000000028B52FFD (./.

Zstandard magic number.

Binary Structure

A Zstandard file contains one or more frames. Each frame starts with the 4-byte magic number 28 B5 2F FD, followed by a frame header containing a frame header descriptor byte, an optional window descriptor (specifying the decompression window size), optional dictID and content size fields. The frame body consists of one or more blocks, each prefixed by a 3-byte block header indicating block type (raw, RLE, or compressed) and block size. Compressed blocks use LZ77 matching with Finite State Entropy (FSE) coding for literals and match lengths. The frame ends with an optional 4-byte content checksum (xxHash-64 truncated to 32 bits). Skippable frames with magic 18 4D 2A 5_ can be interleaved for metadata.

OffsetLengthFieldExampleDescription
0x00 4 bytes Frame Magic Number 28 B5 2F FD Identifies the start of a Zstandard frame.
0x04 1 byte Frame Header Descriptor varies Bit field encoding: frame content size flag (2 bits), single segment flag, content checksum flag, dictID size flag, and reserved bit.
0x05 1 byte Window Descriptor varies Specifies decompression window size as mantissa + exponent. Absent if single segment flag is set.
varies 0-4 bytes Dictionary ID varies Optional dictionary ID field (0, 1, 2, or 4 bytes) identifying which pre-trained dictionary to use.
varies 3 bytes per block Block Header varies Encodes last-block flag (1 bit), block type (2 bits: raw/RLE/compressed/reserved), and block size (21 bits).
EOF-4 4 bytes Content Checksum varies xxHash-64 of original content truncated to 32 bits. Present only if checksum flag is set in frame header.
2015Yann Collet releases Zstandard at Meta (Facebook), targeting real-time compression workloads2016Zstandard 1.0 released; adopted by Linux kernel for firmware and initramfs compression2018RFC 8478 published, standardizing Zstandard as a registered content-encoding for HTTP2019RFC 8878 published for Zstandard use in HTTP Content-Encoding and Transfer-Encoding2020Arch Linux switches default package compression from xz to zstd for pacman packages2021Fedora adopts zstd for RPM package compression; PostgreSQL adds zstd for WAL compression
Compress a file with zstd other
zstd -19 -k file.tar

-19 uses compression level 19 (high ratio). -k keeps the original file. Output is file.tar.zst.

Decompress a .zst file other
zstd -dk file.tar.zst

-d decompresses, -k keeps the original. Produces file.tar.

Multi-threaded compression with zstd other
zstd -T0 -19 -k largefile.sql

-T0 auto-detects CPU cores for parallel compression. Fully compatible with single-threaded decompression.

Train a dictionary for small files other
zstd --train samples/* -o mydict.dict

Trains a compression dictionary on sample files. Dictionaries dramatically improve ratio for small data (JSON logs, short messages) where LZ77 cannot build sufficient context.

Compress with a trained dictionary other
zstd -D mydict.dict -19 input.json -o input.json.zst

-D loads a pre-trained dictionary. Both compressor and decompressor must use the same dictionary.

ZST GZ transcode lossless Decompress zstd and recompress with gzip for compatibility with tools and web servers that only support gzip content-encoding.
ZST XZ transcode lossless Recompress to XZ (LZMA2) for maximum compression ratio when archive size matters more than decompression speed.
LOW

Attack Vectors

  • Decompression bomb: crafted zstd frame with extreme ratio can exhaust memory during extraction
  • Malformed frame header can cause older zstd versions to read out-of-bounds window descriptor

Mitigation: FileDex does not decompress, parse, or execute ZST content. Reference page only — no server-side processing.

zstd (CLI) tool
Reference compressor and decompressor by Yann Collet, maintained by Meta
pzstd tool
Multi-threaded zstd wrapper included in the official zstd distribution
7-Zip tool
Free archiver with Zstandard support in recent versions
python-zstandard library
Python bindings for the zstd C library with streaming support
zstd-rs library
Pure Rust implementation of Zstandard decompression
zstd-jni library
JNI bindings for Zstandard with Java streaming API support