Introduction
7z is the archive format of 7-Zip, the free archiver Igor Pavlov first released in 1999. It is known for small archives: by default it uses LZMA2 compression and compresses many files together as one solid stream, so similar files help each other compress. It can also encrypt both the contents and the file names with AES-256.
Structure
A 7z file starts with a fixed 32-byte signature header. The compressed data comes next, and the header that lists the files comes at the end, where the signature header points to it. The end header is often compressed itself. Numbers are little-endian.
0Signature header37 7A BC AF 27 1C(7zand four fixed bytes), version, CRC12 bytes12Next header pointer offset, size and CRC of the end header20 bytes32Packed streams the compressed datavaries…End header streams, coders, and the names, sizes and times of the filesvaries
Each folder of packed data names the coders that produced it, such as LZMA, LZMA2, PPMd, BZip2 or Deflate, along with filters such as BCJ for machine code and AES-256 for encryption. The end header is usually compressed itself, and when it is encrypted the file names cannot be read without the password.
The reference pages cover every part:
- Signature header – the first 32 bytes, and the variable-length numbers 7z uses
- Header and property IDs – every property ID, the streams, folders, coders and the files info
- Coders and method IDs – the method register, and the properties of LZMA, LZMA2, PPMd and 7zAES
- Codec algorithms – what PPMd, BCJ2, Deflate64, Delta, Swap and the branch filters do to the data
- Special cases and damage – self-extractors, split volumes, Unix modes and links, anti items, encrypted headers, and finding a header again
Drop a .7z file on this page to open it in the explorer: the structure tree shows every byte
(signature header, packed streams, header records), the Files table lists the items with their sizes, times,
attributes and CRC-32, and each file opens on its own, unpacked from its folder. A packed header is unpacked
and shown too. Archives behind a self-extractor stub, with a zeroed or damaged start header, or cut short are read as far
as they go and the problems are listed.
Not described
Checked on 2026-11-13 against 7-Zip’s 7zFormat.txt, Methods.txt
(26.04), its reader and codec sources, 7-Zip 26.06 built from that source, and 247 real
.7z files on the machine that made these pages.
Known, not yet covered
- Viewer: encrypted data. A folder that uses 7zAES is listed and marked, its salt, IV and hashing rounds are shown, and nothing is decoded: the explorer does not ask for a password and the options bar has no field for text. An archive with an encrypted header shows only the signature header and the packed bytes, with the encrypted header’s coder. The key procedure is on the methods page.
- Viewer: methods that other formats use and that 7-Zip can name in a 7z folder: ZIP Shrink, Implode, LZMA, PPMd and Zstandard, RAR, ARJ, LZH, Cab, NSIS, the external codecs (Zstandard, Brotli, LZ4, LZ5, Lizard, LZHAM, WavPack2, Transpose) and the Alpha and M68 branch filters. Their folders are listed with the method’s name and shown as packed bytes; no 7z archive made by 7-Zip itself uses them. The method IDs are on the methods page.
- Viewer: a very large solid block. A file is read by decoding its folder from the start up to the end of that file, with its packed streams read into memory, and a file over 256 MB is not offered as an entry. The decoding is not streamed; a BZip2 folder is always decoded whole, and the shared LZMA decoder stops at 256 MB of output, so a plain-LZMA folder that unpacks to more than that (one real 352 MB archive) cannot be read to its end.
- Viewer: when the archive is opened, folders are decoded and checked against their CRC-32s until 64 MiB of unpacked data have been checked. A folder past that is checked when a file in it is opened; a decoding or CRC-32 failure then joins the Problems list, marked as found after opening, and the Overview’s “Data check” row does not change.
- Viewer: the other volumes of a split archive. A dropped
.7z.001shows only what that file holds, and the list of files, which is in the last volume, cannot be shown (special cases). - Reference: the PPMd, BCJ2 and branch-filter pages (codecs) describe what each does, in words, not every constant and table of the algorithms; the source of the working decoders is the exact description.
- Reference: how an archive handler turns a password into the bytes that 7zAES
hashes (not in
7zAes.cpp), and the exact meaning of thekStartPosvalues. - Reference: the multi-volume format, which 7-Zip’s
7zHeader.hsays is not finished and keeps disabled (the.001volumes are plain cuts of one archive).
Unknown
- Reference: the layout and meaning of
kComment(listed with no layout);kNtSecure,kParentandkIsAuxexist only as commented-out names in 7-Zip’s source. The viewer shows such a property as its ID and size, and its bytes.
Links
Software
- 7-Zip – the free archiver the format was made for, with a command-line version for other systems (Windows, macOS, Linux)
- PeaZip – free archiver that opens and makes 7z files (Windows, macOS, Linux)
- WinRAR – archiver that extracts 7z files (Windows)
- The Unarchiver – free extractor for many formats (macOS)
Developers
- LZMA SDK – Igor Pavlov’s code for LZMA and 7z (C, C++, C#, Java)
- libarchive – reads and writes 7z among many formats (C)
- py7zr – reads and writes 7z archives (Python)
Reference
- LZMA SDK – includes
7zFormat.txt, the description of the 7z format