Fix unrar Error: Not a RAR Archive

Encountering the "Not a RAR archive" error from the unrar utility indicates that the program cannot detect a valid RAR header signature at the beginning of the file. This typically happens when a file is corrupted, incompletely downloaded, saved as a webpage instead of the actual data, or masked with an incorrect .rar file extension. This guide breaks down the technical reasons behind this error and provides direct solutions to diagnose and open your file.

Why the Error Occurs

The unrar command relies on "magic bytes"—a unique hexadecimal signature located at the very start of a file—to verify its integrity.

  • RAR 4.x archives start with the hex signature 52 61 72 21 1A 07 00 (Rar!...).
  • RAR 5.0+ archives start with 52 61 72 21 1A 07 01 00 (Rar!....).

If unrar reads anything other than these specific bytes in the header, it immediately halts operations and reports "Not a RAR archive" to prevent reading corrupted data.

Common Causes and How to Fix Them

1. The File Is an HTML Page or Error Document

When downloading files using command-line tools like wget or curl, or via download managers, server errors or authentication walls can cause the server to return an HTML page (such as a 403 Forbidden or 404 Not Found response) saved under the target file name.

How to verify: Inspect the file contents using a text viewer or the head command:

head -n 5 archive.rar

If the output contains HTML tags such as <!DOCTYPE html> or <html>, the actual archive was never downloaded. Re-download the file directly using an authenticated browser session or direct link.

2. Incorrect File Extension

Files created using other compression tools (like ZIP, GZIP, or 7-Zip) are sometimes mistakenly renamed with a .rar extension.

How to verify: On Linux or macOS, use the file utility to determine the actual file type:

file archive.rar
  • If the output states Zip archive data, rename the file to .zip and use unzip.
  • If it states 7-zip archive data, rename it to .7z and use 7z x.
  • If it states gzip compressed data, rename it to .gz and use gunzip.

3. Incomplete or Interrupted Download

If a download drops before completion, the file size may be smaller than expected, or the internal structure may be truncated.

How to fix: Compare the local file size against the source size stated on the host website. If the sizes do not match, or if a cryptographic hash (MD5 or SHA-256) is provided by the source, verify it:

sha256sum archive.rar

If the checksums do not match, delete the file and download it again.

4. Multi-Volume Archive Sequencing

In multi-part archives (e.g., archive.part01.rar, archive.part02.rar, or older formats like .rar, .r00, .r01), running unrar against an intermediate volume rather than the first volume often triggers archive errors.

How to fix: Always target the primary volume when extracting multi-part sets:

unrar x archive.part1.rar

Ensure all sequential parts are in the same directory before running the command.

5. Try 7-Zip as an Alternative

If the file is a valid RAR file that has minor non-standard formatting, the standard unrar tool may reject it, whereas the p7zip implementation might succeed.

Install and run 7-Zip:

7z x archive.rar