Files & Folders

Repair a corrupted .zip or .rar archive

Most 'corrupt archive' cases are truncation: the compressed entries are fine but the directory at the end of the file is missing. Tools can rebuild the directory or scan forward through the entries.

Stop doing this first

The safe order of operations

  1. 1

    Work on a copy and compare the file size to the expected size — a short file means a failed transfer.

  2. 2

    Try zip -FF to rebuild the central directory into a new archive.

  3. 3

    For RAR, use the repair command; recovery records make this far more likely to succeed.

  4. 4

    If the container is unrecoverable, carve individual files out of the raw bytes instead.

Commands that do the work

Check integrity

unzip -t broken.zip

Rebuild the archive

zip -FF broken.zip --out repaired.zip

Repair a RAR

unrar r broken.rar

Carve files from raw bytes

photorec broken.zip

Realistic odds

Partially recoverable in most truncation cases; early-header damage can still yield later files.

Your case will differ in the details. Load this scenario into the recovery form and add what you already tried — you'll get a plan for your exact situation.

Get my recovery plan

Related guides