Archive repair

How to Repair a Corrupted ZIP or RAR File (and When You Can't)

"Repair" can mean very different things. A ZIP whose last few kilobytes are missing can often be rebuilt; a file with damaged compressed data usually cannot be fixed, only partly rescued. This guide helps you tell the cases apart, shows the tools and commands that genuinely help, and explains when a fresh copy is the only real fix.

Updated 2026-10-13 · Written and tested by the UnpackNest editorial team (TECCONET)

Step 1: make a copy before you try anything

Repair tools write new files, but some recovery steps are destructive if you get a command wrong. Copy the damaged archive to a separate folder and work only on the copy. Keep the original until you have the files you need.

Step 2: find out what kind of damage it is

The error message tells you most of what you need to know. Open the archive in two different tools and note the exact wording.

SymptomLikely causeCan it be repaired?
"Unexpected end of archive", file smaller than expectedDownload stopped early (truncation)Partly: files that arrived completely can often be recovered
ZIP: "central directory not found" / "invalid archive"The end of the ZIP is missing or damagedOften: the directory can be rebuilt from local headers
"CRC failed" on some files onlyDamaged data inside those filesRarely: other files are fine; damaged ones need a fresh copy
RAR: "Corrupt header"Damaged header blockSometimes, especially with a recovery record
"Wrong password" or CRC errors in an encrypted archiveOften a wrong password, not damageTry the password again first
File is tiny (a few KB)An error page saved as .zip/.rarNo: there is no archive to repair

See what UnpackNest reports

UnpackNest's tools do not attempt repairs, but they are a quick, private way to diagnose. The ZIP tool reads the central directory at the end of the file, so a cut-off download is detected immediately, before you waste time with other tools.

  1. Open the ZIP tool or the RAR tool.
  2. Choose the damaged file.
  3. Read the status line. "The archive is incomplete or truncated" means the end is missing. A checksum error on one entry means that entry's data is damaged.
A ZIP cut in half, opened in the UnpackNest ZIP tool. The tool reports a truncated archive instead of listing files it cannot read.
A ZIP cut in half, opened in the UnpackNest ZIP tool. The tool reports a truncated archive instead of listing files it cannot read.

Repairing a ZIP

Rebuild the central directory with Info-ZIP

Every file in a ZIP also has a small local header in front of its data. When the central directory at the end is lost, zip can scan those headers and write a new archive.

  1. Install Info-ZIP (sudo apt install zip on Debian or Ubuntu; it is preinstalled on macOS).
  2. Run zip -FF damaged.zip --out fixed.zip and answer the prompts.
  3. Test the result: unzip -t fixed.zip.

zip -F (one F) is a lighter fix for a slightly damaged directory; -FF scans the whole file and is the one to use for truncated downloads. Files that were completely downloaded come back; the file that was being written when the download stopped is usually lost.

Extract what you can with 7-Zip

7-Zip often lists and extracts the intact files of a damaged ZIP even when Windows refuses to open it. Open the archive in 7-Zip, select everything, and extract. It reports errors on broken entries and keeps going. On Linux: 7zz x damaged.zip -orescued.

Repairing a RAR

Use the recovery record, if there is one

RAR can store a "recovery record": extra parity data added when the archive was created. With it, WinRAR can rebuild damaged parts.

  1. Open the archive in WinRAR.
  2. Choose Tools > Repair archive (Alt+R).
  3. Choose a folder and press OK. WinRAR writes rebuilt.name.rar (or fixed.name.rar).
  4. Open the rebuilt archive and test it with Tools > Test archive.

From the command line, rar r damaged.rar does the same. Without a recovery record, Repair can only reconstruct the headers it can still find, so damaged data stays damaged.

Missing parts of a multi-volume RAR

If a set came with .rev files, WinRAR can rebuild a missing or damaged volume from them: put all parts and .rev files in one folder and open the first part. Without .rev files, a missing volume cannot be recreated.

What does not work

The fix that works most often: a fresh copy

Most "corrupted" archives are incomplete downloads or damaged transfers, and the source still has a good copy.

  1. Compare your file size with the size on the download page.
  2. If a SHA-256 checksum is published, compare it: certutil -hashfile file.zip SHA256 on Windows, shasum -a 256 file.zip on macOS and Linux.
  3. Download again on a stable connection, without download accelerators.
  4. If the second copy has the same checksum and still fails, the archive was damaged before upload. Ask the sender to recreate it.

Preventing damage next time

Frequently asked questions

Can a corrupted archive damage my computer?

Not by being damaged. But a "corrupted" archive from an unknown sender that asks you to run a "repair tool" is a common trick; do not run unexpected programs.

Why do other files extract but one fails?

ZIP and non-solid RAR archives store each file separately, so damage stays local. Solid RAR and 7z archives compress files together, so damage can spread to later files.

Is there a tool that fixes every corrupted ZIP?

No. Tools can rebuild structure and skip broken parts. They cannot recreate data that was never downloaded or was overwritten.

Related guides