Complete Guide to 7-Zip for Archive Recovery
7-Zip is the default tool for archive work on Windows and a strong choice on macOS and Linux. It reads more archive formats than any other free utility, its compression ratio for the native .7z format beats every common alternative, and its tolerance for damaged archives is high enough that it often extracts files when the original archiver refuses. What 7-Zip is not is a repair tool. There is no --repair command. Recovery from a damaged archive in 7-Zip means trying alternative code paths — list, test, GUI inspection, parser mode, hex editing — and accepting that some archives are genuinely unrecoverable.
This guide covers installation, the daily-use commands, the recovery techniques that actually work, and the official limits of what 7-Zip can do for damaged files.
When to use 7-Zip
7-Zip is the right tool for:
Extracting almost any archive format. Native read/write support for 7Z, ZIP, GZIP, BZIP2, TAR, XZ, and WIM. Read-only support for RAR, ISO, CAB, DMG, MSI, NSIS, ARJ, CPIO, RPM, DEB, and many more. For “I have this archive and need to look inside” tasks, 7-Zip is almost always the correct first attempt.
Testing archive integrity before extraction. 7z t archive.7z validates checksums without writing any files. For a multi-gigabyte archive on slow storage, this is hours faster than extracting and finding out at the end.
Recovering files from partially-damaged archives. When some files in an archive are intact and some are damaged, 7-Zip’s GUI extraction often succeeds on the intact ones and reports specific errors on the bad ones, leaving you with the recoverable subset. Other archivers sometimes abort on the first error.
Producing the smallest possible compressed files. The native .7z format with LZMA2 compression typically produces 30–70% smaller archives than ZIP for text and source code. For archives intended for download, this matters.
Splitting and joining large archives. 7-Zip’s split-volume support produces consistently-named multi-part archives that work across platforms.
7-Zip is not the right tool for:
Repairing structurally damaged archives. 7-Zip has no repair command. The official recovery technique for damaged 7Z files is hex-editing the Start Header to a canonical byte sequence — feasible for technically-inclined users with a hex editor, not feasible for most.
Recovering RAR archives with damaged recovery records. RAR’s own recovery record format is best handled by WinRAR itself. 7-Zip can read RAR archives but does not use recovery records during extraction.
Cracking lost passwords. 7-Zip prompts for the password and does not attempt to bypass it. ZIP password protection varies in strength: legacy ZipCrypto is weak and crackable with separate tools; modern AES-256 ZIP is genuinely strong. AES-encrypted 7Z files use AES-256 throughout and are not feasible to crack.
Repairing severely damaged ZIP files where the central directory is gone. For that, Info-ZIP’s zip -FF (the “fix-fix” mode) or commercial ZIP repair tools are better suited.
Installation
Windows
Download the installer from 7-zip.org/download.html. Choose the 64-bit Windows x64 installer for modern systems. Run with default options.
After installation, 7-Zip is available three ways:
- GUI: Start menu → 7-Zip → 7-Zip File Manager
- Right-click context menu: Right-click any file or folder → 7-Zip → [extract or compress options]
- Command line:
7z.exeis inC:\Program Files\7-Zip\. Add this toPATHto use7zdirectly from any shell.
Verify with:
7z --help
macOS
Native macOS 7-Zip is available since 2022 from the official 7-zip.org site. Download the .dmg, drag to Applications, and the 7zz command (note: 7zz, not 7z, on macOS) is included.
For a more convenient setup, Homebrew installs the Linux-style p7zip package, which provides the 7z command:
brew install p7zip
Either path works. The native version stays current with Igor Pavlov’s releases; p7zip occasionally lags but uses the standard 7z command name that scripts expect.
Linux
7-Zip is in every distribution’s repository, packaged as p7zip or 7zip:
# Debian, Ubuntu, Mint
sudo apt install p7zip-full p7zip-rar
# Fedora
sudo dnf install p7zip p7zip-plugins
# Arch
sudo pacman -S p7zip
The p7zip-rar package (Debian/Ubuntu) and p7zip-plugins package (Fedora) add RAR support, which is licensed separately from the main 7-Zip code. Install both for full format coverage.
Verify with:
7z --help
Common recipes
All examples use 7z as the command name. On macOS native installs, substitute 7zz.
List archive contents without extracting
7z l archive.zip
Output includes filename, size, compressed size, and modification date for each entry. Useful for “what’s in this archive” before deciding to extract.
For more detail including CRC checksums and compression method:
7z l -slt archive.zip
The -slt flag enables “show technical info” output.
Test archive integrity
7z t archive.7z
Reads the entire archive and verifies CRC checksums, without writing any files. Exit code 0 indicates a clean archive; non-zero indicates errors. Output lists the specific files that failed integrity checks, which is useful for understanding which parts of an archive are damaged.
For password-protected archives, supply the password:
7z t -p"your-password" archive.7z
Extract all files
7z x archive.zip -o./output
The -o flag specifies output directory, with no space between -o and the path. The x command preserves the directory structure inside the archive. Use e instead of x to extract all files into a single flat directory.
To overwrite existing files without prompting:
7z x archive.zip -o./output -aoa
-aoa means “overwrite all without asking.” Other options: -aos (skip existing), -aou (auto-rename new), -aot (auto-rename existing).
Extract specific files
Extract only files matching a pattern:
7z x archive.zip -o./output "*.txt" -r
The -r flag recurses into subdirectories within the archive. Without it, only top-level matches are extracted.
Recover what you can from a partially-damaged archive
When a normal extract fails partway through:
- Run
7z l archive.zipto see what 7-Zip can identify in the archive. - Run
7z t archive.zipto see which specific files are damaged. - Run
7z x archive.zip -o./outputand let it process — for many damaged archives, 7-Zip will extract the intact files and report errors on the damaged ones, leaving you with the recoverable subset.
For archives that fail at the listing stage, try opening in the 7-Zip File Manager GUI instead. The GUI uses a slightly different code path and sometimes succeeds where the command-line tool fails.
Recover damaged 7Z archives via header reconstruction
This is the technique documented at 7-zip.org/recover.html. It is the only sanctioned recovery method for 7Z files with damaged headers, and it requires a hex editor and an understanding of the 7Z file format.
The approach: if the End Header at the end of the archive is intact and you only need to repair the Start Header at the beginning, replace the first 32 bytes with a canonical “minimal valid” Start Header that points 7-Zip to scan for the End Header itself. The 7-zip.org recovery page provides the exact byte sequence and worked examples.
This technique is genuinely useful for archives where the start of the file was overwritten or corrupted but the rest is intact. It is not a fix for archives where data in the middle is damaged, and it is not a substitute for understanding what you are doing — backup the damaged archive before any hex-edit attempt.
Open archives within damaged files (parser mode)
For solid-block 7Z archives where standard recovery fails, 7-Zip 19.00 and later includes a parser mode that scans raw data for archive signatures. In the GUI:
- Right-click the damaged file in 7-Zip File Manager.
- Select 7-Zip → Open Archive → #
- 7-Zip scans for embedded archive structures and presents what it finds.
This is a last-resort technique for severely damaged archives and produces files without their original names. Useful when other approaches have failed and you need to recover what you can.
Create a 7Z archive
7z a archive.7z file1 file2 directory/
The a command means “add.” Files and directories are added to a new archive. To use maximum compression:
7z a -mx=9 archive.7z directory/
-mx=9 enables ultra compression. Slow but smallest output. -mx=5 (the default) is normal compression, much faster.
Create a password-protected 7Z archive
7z a -p"your-password" -mhe=on archive.7z directory/
-mhe=on encrypts the file headers as well as the contents, so even the list of filenames is hidden. Without -mhe=on, anyone can see filenames in the archive even without the password. 7Z encryption uses AES-256 throughout.
Split a large archive into volumes
7z a -v100m archive.7z large_directory/
Produces archive.7z.001, archive.7z.002, etc., each up to 100MB. To extract, all volumes must be present in the same directory; specify the first volume to start:
7z x archive.7z.001
Limitations and known issues
There is no repair command. This is the most important thing to know about 7-Zip. When an archive is damaged, 7-Zip can extract intact entries but cannot reconstruct damaged ones. For repairs that require reconstructing data, 7-Zip is not the tool.
The -y flag does not skip CRC errors. A common misconception is that 7z x -y archive.zip will extract files even when checksums fail. It does not. The -y flag answers yes to interactive prompts about overwriting existing files; it has no effect on CRC validation. Files that fail integrity checks during extraction cause errors regardless of -y.
RAR support is read-only. 7-Zip extracts RAR archives but cannot create them. RAR’s recovery record feature, which can repair certain damaged RAR archives, is only usable through WinRAR, not 7-Zip.
Multi-volume archives must be complete. 7-Zip cannot extract from a multi-volume archive if any volume is missing. There is no partial extraction across an incomplete set of volumes.
Solid archives degrade gracefully but unpredictably. 7Z archives compressed with solid blocks share compression context across files, which improves ratios but means damage in the middle of a solid block can affect all subsequent files in that block. Non-solid archives degrade per-file; solid archives degrade per-block.
The GUI and CLI sometimes disagree. Reports surface periodically of files that the GUI extracts cleanly but the CLI fails on, or vice versa. The two share most of their code but use different I/O paths. If one fails, try the other before concluding the archive is unrecoverable.
No password recovery. 7-Zip does not crack or recover lost passwords. For weak ZipCrypto-protected ZIP files, separate tools like fcrackzip or hashcat may help. For AES-encrypted archives — the default for modern 7Z and modern AES ZIP — recovery without the password is generally not feasible.
Alternatives
WinRAR is the right tool for RAR-specific work, particularly archives created with recovery records. Its repair feature for damaged RAR archives is more capable than anything 7-Zip can do on RAR.
Info-ZIP utilities (zip, unzip) are the standard Unix command-line ZIP tools. The zip -FF “fix-fix” mode can sometimes recover ZIP archives where the central directory is missing or damaged — a problem 7-Zip handles less well.
The system-default archive utility (Windows Explorer’s built-in ZIP support, macOS Archive Utility, GNOME Archive Manager) handles routine archive work and is fine for occasional users. For damaged archives, switch to 7-Zip immediately; the system tools have minimal tolerance for malformed files.
DiskInternals ZIP Repair, Stellar Repair for ZIP, and similar commercial tools automate ZIP-specific recovery techniques with a GUI. Worth considering for one-off urgent ZIP recoveries; for routine work, 7-Zip plus a hex editor handles more cases.
PeaZip is a free GUI archiver built on 7-Zip’s code with a more polished interface. For users who prefer not to use 7-Zip’s somewhat dated interface, it is a reasonable alternative with the same underlying capability.
Last verified: April 2026