ZIP, RAR, 7z and tar: how to tell an archive from a broken download

A ZIP starts with PKx03x04; an empty ZIP starts with PKx05x06 instead, because the end-of-central-directory record is the only thing in the file. A RAR starts with the ASCII word Rar! plus 1A 07 00, and RAR 5 adds 01 00 after it. 7z starts with 37 7A BC AF 27 1C.

A truncated file loses its end record, which is why a broken download ‘opens’ in some tools and fails in others: the tool found the header but not the index. Compare the byte count against the manifest before you try again.

Where this came from

Notes like this one come out of the file library rather than out of a release schedule. The pages linked above are the entries that were being worked on when the note was written, and those entries are rebuilt with each release of the toolset, so a note can go out of date in a way a format page does not.

When that happens the note stays where it is and gets a correction at the bottom rather than being rewritten, because the point of most of these notes is the order things were tried in. The editors who write them are the ones who maintain the catalogue.