Magic bytes reference
Identify file types by real magic bytes: 162 signatures from public specs (PNG, JPEG, ZIP, ELF, SQLite, 7z, WASM and more), matched against a pasted hex header or the first 4096 bytes of a local file, plus search by hex prefix, extension or category.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Hex accepts spaces, commas, colons and 0x / \x prefixes. The first few dozen bytes are enough; a shorter input is matched as a prefix (at least 2 bytes).
Only the first 4096 bytes are read, locally, and nothing is uploaded.
Header identification
Matches are ranked by the number of literal bytes matched, so the first line is the most likely type; formats sharing a signature (such as CAFEBABE) are listed together.
Paste a file header in hex or pick a file to identify its type
Reference table search
A hex prefix is matched against literal bytes (?? wildcards are skipped); extensions work with or without the dot, and an empty query browses the whole table.
Entries: 162 · Shown: 60
89 50 4E 47 0D 0A 1A 0ASource: PNG 规范 (ISO/IEC 15948) §5.2 Signature
FF D8 FF E0 00 10 4A 46 49 46 00 01Source: JFIF 1.02 规范 (ITU-T T.871) §4.1
FF D8 FF E1Source: Exif 2.3 规范 (CIPA DC-008) APP1 标记
FF D8 FF DBSource: JPEG 规范 (ITU-T T.81) 标记码表
00 00 00 0C 6A 50 20 20 0D 0A 87 0ASource: JPEG 2000 (ISO/IEC 15444-1) §I.5.1 Signature box
FF 4F FF 51Source: JPEG 2000 (ISO/IEC 15444-1) Annex A 标记
47 49 46 38 37 61Source: GIF87a 规范 §17 Header
47 49 46 38 39 61Source: GIF89a 规范 §17 Header
42 4DSource: Windows BITMAPFILEHEADER (Win32 API 文档)
49 49 2A 00Source: TIFF 6.0 规范 §2 Image File Header
4D 4D 00 2ASource: TIFF 6.0 规范 §2 Image File Header
52 49 46 46 ?? ?? ?? ?? 57 45 42 50Source: WebP 容器规范 (RFC 9649) §2.1
00 00 01 00Source: ICO 格式 (Microsoft ICONDIR 结构)
00 00 02 00Source: CUR 格式 (Microsoft ICONDIR 结构)
69 63 6E 73Source: Apple Icon Image 格式文档
38 42 50 53Source: Adobe Photoshop File Format 文档
67 69 6D 70 20 78 63 66 20 66 69 6C 65Source: GIMP XCF 文件格式说明
44 44 53 20Source: Microsoft DirectDraw Surface (DDS) 文档
AB 4B 54 58 20 31 31Source: Khronos KTX 1 文件格式规范
AB 4B 54 58 20 32 30Source: Khronos KTX 2 文件格式规范
13 AB A1 5CSource: ARM ASTC 纹理压缩格式文档
71 6F 69 66Source: QOI 格式规范 (qoi-spec)
76 2F 31 01Source: OpenEXR 文件格式规范 §1
46 4C 49 46Source: FLIF 格式说明 (flif.info)
42 50 47 FBSource: BPG 格式规范 (bellard.org/bpg)
FF 0ASource: JPEG XL (ISO/IEC 18181-1) §7.1
00 00 00 0C 4A 58 4C 20 0D 0A 87 0ASource: JPEG XL 容器格式 (ISO/IEC 18181-2) §4.2
49 49 BC 01Source: JPEG XR (ISO/IEC 29199-2) 文件格式
53 49 4D 50 4C 45 20 20 3DSource: FITS 标准 (IAU FITS 4.0) §4.1
50 36Source: Netpbm 格式文档 (ppm 手册)
50 35Source: Netpbm 格式文档 (pgm 手册)
50 31Source: Netpbm 格式文档 (pbm 手册)
52 49 46 46 ?? ?? ?? ?? 41 43 4F 4ESource: Microsoft RIFF ACON 格式文档
66 74 79 70 68 65 69 63Source: ISO/IEC 23008-12 (HEIF) / ISO/IEC 14496-12 ftyp
66 74 79 70 61 76 69 66Source: AVIF 规范 (AOMedia) / ISO/IEC 14496-12 ftyp
66 74 79 70 69 73 6F 6DSource: ISO/IEC 14496-12 (ISOBMFF) §4.3 File Type Box
66 74 79 70Source: ISO/IEC 14496-12 §4.3 File Type Box
6D 6F 6F 76Source: QuickTime File Format 文档 (Apple)
52 49 46 46 ?? ?? ?? ?? 41 56 49 20Source: AVI 文件格式 (Microsoft RIFF AVI)
66 74 79 70 4D 34 41 20Source: ISO/IEC 14496-12 §4.3 / Apple M4A brand
66 74 79 70 33 67 70Source: 3GPP TS 26.244 (3GPP 文件格式)
1A 45 DF A3Source: EBML (RFC 8794) §11 / Matroska 规范
46 4C 56 01Source: Adobe FLV/F4V 格式规范
00 00 01 BASource: MPEG-1 (ISO/IEC 11172-1) / MPEG-2 (13818-1) 系统层
00 00 01 B3Source: MPEG-2 (ISO/IEC 13818-2) 语法
47Source: MPEG-2 (ISO/IEC 13818-1) 传输流语法
30 26 B2 75 8E 66 CF 11 A6 D9 00 AA 00 62 CE 6CSource: ASF 规范 (Microsoft) §3.1 Header Object
2E 52 4D 46Source: RealMedia 文件格式文档 (RealNetworks)
44 4B 49 46Source: IVF 格式说明 (libwebm / VP8 测试码流)
06 0E 2B 34 02 05 01 01 0D 01 02Source: SMPTE 377M (MXF) KLV 键定义
66 4C 61 43Source: FLAC 格式规范 §Stream 标记
4F 67 67 53Source: Ogg 封装 (RFC 3533) §6
49 44 33Source: ID3v2.4 规范 §3
FF FBSource: MPEG-1 (ISO/IEC 11172-3) 帧头语法
FF F3Source: MPEG-2 (ISO/IEC 13818-3) 帧头语法
FF F1Source: MPEG-4 Audio (ISO/IEC 14496-3) ADTS 语法
52 49 46 46 ?? ?? ?? ?? 57 41 56 45Source: RIFF WAVE 格式 (Microsoft Multimedia Standards Update)
46 4F 52 4D ?? ?? ?? ?? 41 49 46 46Source: AIFF-C 规范 (Apple, EA IFF 85 派生)
46 4F 52 4D ?? ?? ?? ?? 41 49 46 43Source: AIFF-C 规范 (Apple)
4D 54 68 64Source: SMF 规范 (MIDI 1.0 标准文件格式)
What this tool does
- Confirm the real type of a file that has no extension or a suspicious one, using just its first few dozen bytes
- Debug "this file will not open": check whether a ZIP was renamed to .jpg, or UTF-16 text is being treated as binary
- Use it as a reference: look signatures up by hex prefix such as 89 50 4E 47, by extension or by category, each with its source
Example
Input
89 50 4E 47 0D 0A 1A 0A
Output
bytes: 8 matches: 1 png | 89 50 4E 47 0D 0A 1A 0A | .png | image | matched 8/8
Each line is: entry id | signature | extensions | category | literal bytes matched / total literal bytes.
Frequently asked questions
How many entries are there and what are they based on?
162 signatures covering images, audio/video, archives, documents, executables, fonts, databases, disk images, certificates and keys. Every entry carries a source field (PNG spec §5.2, RFC 1952, PKWARE APPNOTE 6.3.10, SQLite file format §1.2 and so on) instead of guesswork; formats that are missing simply report "no signature matched".
How do you decide when several signatures match?
Matches are ranked by the number of literal bytes matched, so the first line is the most likely type. Formats that share a signature are listed together: CAFEBABE is both a Java class and a Mach-O universal binary, and the RIFF prefix belongs to WebP, WAV, AVI and ANI alike — you need the following bytes or the internal entries to settle it.
Can a few bytes be enough?
Yes. When the input is shorter than a signature it is matched as a prefix, but at least 2 literal bytes must match so that 1-byte signatures (MPEG-TS 0x47, EOT 4C 50) do not fire everywhere; those lines are marked (prefix).
Can magic bytes replace real format parsing?
No. A header only says what the file claims to be and can be forged with a few bytes; a renamed ZIP is still a ZIP, and docx/xlsx/pptx/apk/jar are all ZIP files that need their internal entries inspected. Security decisions require parsing the structure — this tool only compares signatures, does not validate integrity, and reads at most the first 4096 bytes for comparison.
Does picking a file leak its content?
No network access is used. The browser reads the file locally with FileReader and only the first 4096 bytes are converted to hex, so even huge files answer instantly. You can also copy the header bytes yourself and paste them.
Keywords:magic bytes文件头文件签名文件类型检测magic numberfile signature十六进制文件头PNG 89 50 4E 47file type checker