ZIP local file header signature
50 4B 03 04These are the on-disk bytes for the 32-bit value 0x04034B50. Most archives begin with this local header, although prefixed or self-extracting archives can place other data before it.
Local file header fields
| Offset | Length | Field |
|---|---|---|
| 0x00 | 4 | Local header signature |
| 0x04 | 2 | Version needed to extract |
| 0x06 | 2 | General-purpose bit flags |
| 0x08 | 2 | Compression method |
| 0x0A | 2 | Last modification time |
| 0x0C | 2 | Last modification date |
| 0x0E | 4 | CRC-32 |
| 0x12 | 4 | Compressed size |
| 0x16 | 4 | Uncompressed size |
| 0x1A | 2 | File name length |
| 0x1C | 2 | Extra field length |
| 0x1E | Variable | File name, extra field, then file data |
Central directory and end records
Central-directory file headers use 50 4B 01 02. The classic End of Central Directory record uses 50 4B 05 06 and stores the entry count, central-directory size and offset, plus an optional archive comment.
ZIP64 archives add ZIP64 end records and locators when classic 16- or 32-bit fields cannot represent the actual values. Do not assume a zero or maximum placeholder is the final size without checking ZIP64 metadata.
Practical ZIP inspection checks
- Interpret fixed numeric fields as little-endian.
- Calculate the payload start as 30 + file-name length + extra-field length from the local header start.
- Check general-purpose bit 3 before relying on CRC and sizes in the local header; a trailing data descriptor may carry them.
- Remember that JAR, APK, DOCX, XLSX, PPTX, EPUB, and other formats can use ZIP as a container.
- Use a hardened archive library before extracting untrusted names or payloads.
Local processing and privacy
The ZIP file format workflow opens the same Bitpeek browser workspace. Selected file bytes, file names, pasted input, searches, edits, hashes, and comparison data are processed in local browser memory and are not sent to a Bitpeek server.
The static guide itself can be read without opening a file or creating an account.
Technical reference: PKWARE .ZIP Application Note.
Frequently asked questions
Is every file starting with PK a ZIP archive?
No. The bytes are a format clue. Confirm the complete record structure and central directory before treating the file as a valid archive.
Why can local-header sizes be zero?
When general-purpose bit 3 is set, CRC and size values can follow the compressed data in a data descriptor instead of being known when the local header is written.
Does ZIP always start at offset 0?
Typical archives do, but self-extracting and deliberately prefixed files can place other bytes before the first ZIP record.