FILE SIGNATURES
Common magic numbers used to identify a file from its first bytes.
| format | extension | hex | offset | notes |
|---|---|---|---|---|
| PNG | .png | 89 50 4E 47 0D 0A 1A 0A | 0 | Portable Network Graphics |
| JPEG | .jpg | FF D8 FF | 0 | JPEG image |
| GIF | .gif | 47 49 46 38 | 0 | GIF87a or GIF89a |
| 25 50 44 46 2D | 0 | %PDF- | ||
| ZIP | .zip | 50 4B 03 04 | 0 | PKZip; also used by many container formats |
| GZIP | .gz | 1F 8B | 0 | Gzip compressed data |
| BZIP2 | .bz2 | 42 5A 68 | 0 | BZh |
| XZ | .xz | FD 37 7A 58 5A 00 | 0 | XZ compressed data |
| 7ZIP | .7z | 37 7A BC AF 27 1C | 0 | 7-Zip archive |
| RAR | .rar | 52 61 72 21 1A 07 | 0 | RAR archive |
| TAR | .tar | 75 73 74 61 72 | 257 | ustar at offset 257 |
| ELF | 7F 45 4C 46 | 0 | Linux/Unix executable | |
| PE | .exe | 4D 5A | 0 | DOS/Windows executable |
| MACH-O | FE ED FA CE | 0 | 32-bit Mach-O, big-endian | |
| MACH-O | CF FA ED FE | 0 | 64-bit Mach-O, little-endian | |
| WASM | .wasm | 00 61 73 6D | 0 | WebAssembly binary |
| SQLITE | .sqlite | 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 | 0 | SQLite 3 database |
| MP3 | .mp3 | 49 44 33 | 0 | ID3 tag; audio may follow |
| OGG | .ogg | 4F 67 67 53 | 0 | Ogg container |
| FLAC | .flac | 66 4C 61 43 | 0 | fLaC |
| WAV | .wav | 52 49 46 46 | 0 | RIFF container |
| MP4 | .mp4 | 66 74 79 70 | 4 | ftyp box at offset 4 |
| WEBM | .webm | 1A 45 DF A3 | 0 | Matroska/WebM container |
| WOFF | .woff | 77 4F 46 46 | 0 | Web Open Font Format |
| WOFF2 | .woff2 | 77 4F 46 32 | 0 | Web Open Font Format 2 |
| TTF | .ttf | 00 01 00 00 | 0 | TrueType font |
| OTF | .otf | 4F 54 54 4F | 0 | OpenType font |
| ICO | .ico | 00 00 01 00 | 0 | Windows icon |
| BMP | .bmp | 42 4D | 0 | Windows bitmap |
| TIFF | .tif | 49 49 2A 00 | 0 | Little-endian TIFF; big-endian starts 4D 4D 00 2A |