Skip to content

File Signatures and Magic Numbers

Identify common file formats from their opening hexadecimal bytes.

Format Hex signature Text/notes
PDF 25 50 44 46 %PDF
PNG 89 50 4E 47 0D 0A 1A 0A PNG image
JPEG FF D8 FF JPEG image family
GIF 47 49 46 38 GIF8
ZIP / DOCX / XLSX / EPUB 50 4B 03 04 ZIP container; inspect internal files
GZIP 1F 8B Gzip-compressed data
7-Zip 37 7A BC AF 27 1C 7z archive
RAR 52 61 72 21 1A 07 RAR archive
ELF 7F 45 4C 46 Unix/Linux executable or object
Windows EXE 4D 5A MZ; additional PE header later
WebP 52 49 46 46 … 57 45 42 50 RIFF container with WEBP marker
SQLite 53 51 4C 69 74 65 20 66 SQLite f

Browse all useful references

You can change these choices at any time.