Reference
File magic numbers & signatures
A searchable reference of the leading-byte signatures (magic numbers) used to identify file formats, with hex bytes, offsets, file extensions, and MIME types for 50 formats. Detect formats by their bytes, not their extension.
60 signatures
| Format | Category | Hex signature | Offset | ASCII | MIME type |
|---|---|---|---|---|---|
| Advanced Audio Coding .aac | Audio | FF F1 | 0 | .. | audio/aac |
| Advanced Audio Coding .aac | Audio | FF F9 | 0 | .. | audio/aac |
| Audio Video Interleave .avi | Video | 52 49 46 46 | 0 | RIFF | video/x-msvideo |
| AV1 Image File Format .avif | Image | 66 74 79 70 | 4 | ftyp | image/avif |
| Binary glTF .glb | 3D | 67 6C 54 46 | 0 | glTF | model/gltf-binary |
| Cascading Style Sheets .css | Web | 3A 72 6F 6F 74 | 0 | :root | text/css |
| Comma-Separated Values .csv | Data | 6E 61 6D 65 | 0 | name | text/csv |
| Electronic Publication .epub | Document | 50 4B 03 04 | 0 | PK.. | application/epub+zip |
| Excel Open XML Workbook .xlsx | Document | 50 4B 03 04 | 0 | PK.. | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| Executable and Linkable Format .elf .so .o | Executable | 7F 45 4C 46 | 0 | .ELF | application/x-elf |
| Extensible Markup Language .xml | Data | 3C 3F 78 6D 6C | 0 | <?xml | application/xml |
| Extensible Markup Language .xml | Data | 3C | 0 | < | application/xml |
| Free Lossless Audio Codec .flac | Audio | 66 4C 61 43 | 0 | fLaC | audio/flac |
| glTF JSON .gltf | 3D | 7B | 0 | { | model/gltf+json |
| Graphics Interchange Format .gif | Image | 47 49 46 38 37 61 | 0 | GIF87a | image/gif |
| Graphics Interchange Format .gif | Image | 47 49 46 38 39 61 | 0 | GIF89a | image/gif |
| GZIP Compressed Data .gz .gzip | Archive | 1F 8B 08 | 0 | ... | application/gzip |
| HyperText Markup Language .html .htm | Web | 3C 21 64 6F 63 74 79 70 65 | 0 | <!doctype | text/html |
| INI Configuration .ini .conf .cfg | Data | 5B 73 61 6D 70 6C 65 5D | 0 | [sample] | text/plain |
| JavaScript .js .mjs .cjs | Code | 65 78 70 6F 72 74 | 0 | export | text/javascript |
| JavaScript Object Notation .json | Data | 7B | 0 | { | application/json |
| JavaScript Object Notation .json | Data | 5B | 0 | [ | application/json |
| JPEG File Interchange Format .jpg .jpeg | Image | FF D8 FF | 0 | ... | image/jpeg |
| Log File .log | Data | 32 30 32 36 2D | 0 | 2026- | text/plain |
| Markdown .md .markdown | Document | 23 20 | 0 | # | text/markdown |
| MPEG Audio Layer III .mp3 | Audio | 49 44 33 | 0 | ID3 | audio/mpeg |
| MPEG Audio Layer III .mp3 | Audio | FF FB | 0 | .. | audio/mpeg |
| MPEG-4 Audio .m4a | Audio | 66 74 79 70 | 4 | ftyp | audio/mp4 |
| MPEG-4 Part 14 .mp4 .m4v | Video | 66 74 79 70 | 4 | ftyp | video/mp4 |
| Newline Delimited JSON .ndjson .jsonl | Data | 7B | 0 | { | application/x-ndjson |
| Ogg Container .ogg .oga .ogv | Audio | 4F 67 67 53 | 0 | OggS | audio/ogg |
| OpenDocument Text .odt | Document | 50 4B 03 04 | 0 | PK.. | application/vnd.oasis.opendocument.text |
| Plain Text .txt .text | Document | 74 69 74 6C 65 3A | 0 | title: | text/plain |
| Polygon File Format .ply | 3D | 70 6C 79 0A | 0 | ply. | model/ply |
| Polygon File Format .ply | 3D | 70 6C 79 0D 0A | 0 | ply.. | model/ply |
| Portable Document Format .pdf | Document | 25 50 44 46 2D | 0 | %PDF- | application/pdf |
| Portable Network Graphics .png | Image | 89 50 4E 47 0D 0A 1A 0A | 0 | .PNG.... | image/png |
| PowerPoint Open XML Presentation .pptx | Document | 50 4B 03 04 | 0 | PK.. | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| Rich Text Format .rtf | Document | 7B 5C 72 74 66 | 0 | {\rtf | application/rtf |
| Scalable Vector Graphics .svg | Image | 3C 73 76 67 | 0 | <svg | image/svg+xml |
| Scalable Vector Graphics .svg | Image | 3C 3F 78 6D 6C | 0 | <?xml | image/svg+xml |
| SQLite Database .sqlite .sqlite3 .db | Database | 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 | 0 | SQLite format 3. | application/vnd.sqlite3 |
| SubRip Subtitle .srt | Subtitle | 31 0A 30 30 3A 30 30 | 0 | 1.00:00 | application/x-subrip |
| Tab-Separated Values .tsv .tab | Data | 69 6E 64 65 78 09 | 0 | index. | text/tab-separated-values |
| Tagged Image File Format .tif .tiff | Image | 49 49 2A 00 | 0 | II*. | image/tiff |
| Tagged Image File Format .tif .tiff | Image | 4D 4D 00 2A | 0 | MM.* | image/tiff |
| Tape Archive .tar | Archive | 75 73 74 61 72 | 257 | ustar | application/x-tar |
| Tom's Obvious Minimal Language .toml | Data | 74 69 74 6C 65 20 3D | 0 | title = | application/toml |
| VRM Avatar .vrm | 3D | 67 6C 54 46 | 0 | glTF | model/vrm |
| Waveform Audio File Format .wav | Audio | 52 49 46 46 | 0 | RIFF | audio/wav |
| Web App Manifest .webmanifest | Web | 7B | 0 | { | application/manifest+json |
| WebAssembly Binary .wasm | Executable | 00 61 73 6D 01 00 00 00 | 0 | .asm.... | application/wasm |
| WebM .webm | Video | 1A 45 DF A3 | 0 | .E.. | video/webm |
| WebP Image .webp | Image | 52 49 46 46 | 0 | RIFF | image/webp |
| Windows Bitmap .bmp .dib | Image | 42 4D | 0 | BM | image/bmp |
| Word Open XML Document .docx | Document | 50 4B 03 04 | 0 | PK.. | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| YAML Ain’t Markup Language .yaml .yml | Data | 74 69 74 6C 65 3A | 0 | title: | application/yaml |
| ZIP Archive .zip | Archive | 50 4B 03 04 | 0 | PK.. | application/zip |
| ZIP Archive .zip | Archive | 50 4B 05 06 | 0 | PK.. | application/zip |
| ZIP Archive .zip | Archive | 50 4B 07 08 | 0 | PK.. | application/zip |