Skip to main content
7-Zip supports multiple compression methods, each optimized for different types of data and use cases. The compression method is identified by a unique binary ID in the archive format.

Supported Methods

7-Zip supports the following primary compression methods:

LZMA

Original LZMA algorithm with excellent compression ratio

LZMA2

Improved LZMA with multithreading and better handling of incompressible data

PPMd

Prediction by Partial Matching for highly compressible text

BZip2

Block-sorting compression with good ratio and speed

Deflate

Standard ZIP compression method

Method IDs

Each compression method in 7z archives is associated with a unique binary ID:
The method ID is stored in the archive’s coder information and determines which decompression algorithm to use when extracting files.

Filter Methods

In addition to compression methods, 7-Zip supports filter methods that preprocess data before compression:

Choosing a Compression Method

Best for: Most use cases, especially with modern multi-core CPUs
  • Default method in 7z format
  • Supports multithreading
  • Better handling of incompressible data than LZMA
  • Excellent compression ratio
  • Dictionary size up to 1.5 GB (64-bit)
Best for: Maximum compatibility, single-threaded compression
  • Original LZMA algorithm
  • Used in .lzma files and older 7z archives
  • Slightly better compression than LZMA2 in some cases
  • Single-threaded only
  • Dictionary size up to 1.5 GB (64-bit)
Best for: Highly compressible text files, databases, source code
  • Excellent for text and structured data
  • High memory usage
  • Slower than LZMA/LZMA2
  • Best compression for text files
  • Memory size: 1 MB to 2 GB
Best for: Compatibility with other tools, balanced performance
  • Standard BZip2 algorithm
  • Good compression ratio
  • Moderate speed
  • Lower memory usage than LZMA
  • Block size: 100 KB to 900 KB
Best for: ZIP compatibility, fast decompression
  • Standard ZIP compression
  • Fastest decompression
  • Lower compression ratio than LZMA
  • Widely compatible
  • Used in ZIP, gzip, PNG formats

Performance Comparison

Performance varies significantly based on data type, compression level, and hardware. The following table shows typical characteristics:
For general-purpose compression, use LZMA2 with default settings. For text files, try PPMd with a high memory setting. For maximum compatibility, use Deflate.

Custom Method IDs

If you need to add a custom compression method, you can:
  1. Request ID allocation from 7-Zip developers
  2. Generate a random 8-byte ID with the format: 3F ZZ ZZ ZZ ZZ ZZ MM MM
    • 3F: Prefix for random IDs (1 byte)
    • ZZ ZZ ZZ ZZ ZZ: Developer ID (5 random bytes)
    • MM MM: Method ID (2 bytes)
Only use a new method ID if the old codec cannot decode data encoded with the new version. Maintain backward compatibility whenever possible.

Next Steps

LZMA Compression

Learn about the LZMA compression algorithm

LZMA2 Compression

Explore the improved LZMA2 method

PPMd Compression

Discover PPMd for text compression

Command Line Usage

Use compression methods in 7-Zip commands