Before you trust a ZIP file with your data, test it for internal errors. The most direct way to test zip file integrity is to run a verification that checks every entry inside the file without extracting anything. Here are the practical methods on Windows, macOS, and Linux, and how to read the results so you know whether the file is safe to use.

What a Test Archive Command Does

A ZIP test reads each compressed entry, decompresses it in memory, and compares the decompressed data against the stored CRC-32 checksum. If the checksums match, the file is intact. If they do not match, the archive has an internal error. This process does not extract files to your disk. It is safe to run on any ZIP.

A test that fails on one entry identifies which file is damaged. Other entries in the same archive may still be fine. Decide whether to extract only the undamaged files or attempt to repair the corrupted part.

Testing on MacOS, Linux, and Windows with Info-ZIP

The unzip -t tool comes pre-installed on macOS and most Linux distributions. On Windows, install Info-ZIP to get the same utility.

How to use unzip -t

  1. Open a terminal (Command Prompt on Windows, Terminal on macOS or Linux).
  2. Navigate to the folder containing the ZIP file.
  3. Type unzip -t archive.zip and press Enter. Replace archive.zip with the actual filename.

The tool lists each entry as it tests it. A clean result ends with the line: "No errors detected in compressed data of archive.zip." If any entry fails, you will see a message describing the error and the name of the damaged file.

Testing with 7-Zip

7-Zip is a free file archiver with a test function in both its graphical interface and its command line.

Using the 7-Zip graphical interface

  1. Open 7-Zip File Manager.
  2. Navigate to the ZIP file and select it.
  3. Click the "Test" button on the toolbar. The program runs through the archive and reports any errors.

Using the 7-Zip command line

Open a terminal and run: 7z t archive.zip. The output shows each file being tested, followed by a summary. A successful test shows "Everything is Ok." If an error is found, the summary lists the damaged file.

Testing with WinRAR

WinRAR is a popular archiver for Windows that also supports ZIP files. It includes a dedicated test function.

How to use WinRAR's Test command

  1. Open WinRAR and locate the ZIP file.
  2. Select the archive.
  3. Press Alt+T (the keyboard shortcut for the Test function) or click the "Test" button in the toolbar.

WinRAR checks each entry. If the archive is intact, you will see a message that no errors were found. If a file is damaged, WinRAR displays the name of the corrupted file and the type of error.

Interpreting Test Results

When a test completes, the output tells you one of two things:

  • No errors: The archive is internally consistent. Extract its contents with confidence.
  • Errors detected: One or more files failed the CRC-32 check. The error message names the damaged file. You can still extract the undamaged entries, but the corrupted file will be unreadable or incomplete.

If you see errors, do not delete the original files you made the archive from. The originals are your backup until you confirm the archive is good.

When to Test an Archive

Check if a ZIP is corrupted before you rely on it. Test in these situations:

  • After downloading a ZIP file from the internet.
  • Before deleting the original files that you compressed into the archive.
  • After transferring the archive between drives or over a network.
  • If you suspect the archive was damaged during storage.

Testing takes seconds. It can save you from losing data.

What to Do If a Test Fails

A failed test means the archive has an internal error. You have a few options:

  • Extract the undamaged files. The tool will skip or warn about the corrupted entry, but the rest may be fine.
  • Recreate the archive from the original files if you still have them.
  • If you no longer have the originals, attempt a repair. Tools like zip.repair can recover data from a corrupted ZIP file.