Check a file's magic bytes to reveal its real type. Free in-browser signature checker with hex dump, extension-spoofing alerts and a magic number list.
By Inventive HQ
A file’s extension is a label anyone can change. Its magic number — the handful of bytes at the very start of the file — is what the operating system, the browser and the parsing library actually read to decide what the file is. This checker reads those bytes for you: drop one file or a whole batch onto the page, and each one is matched against a signature database, shown with a hex dump, and flagged when the real format disagrees with the extension on the filename.
Files are read locally through the browser’s File API. Nothing is uploaded, so you can inspect malware samples, customer artefacts or evidence copies without them leaving the machine. Only the first 512 bytes of each file are read, which keeps the check instant even on multi–gigabyte files.
These are the header bytes people look up most often. Hex is shown as it appears at offset 0 unless noted, alongside the printable ASCII that makes many of them recognisable at a glance in a hex editor.
| Format | Magic bytes (hex) | ASCII |
|---|---|---|
25 50 44 46 | %PDF | |
| PNG | 89 50 4E 47 0D 0A 1A 0A | .PNG.... |
| JPEG / JPG | FF D8 FF E0 (also E1, E2, E8) | — |
| GIF | 47 49 46 38 37 61 / 47 49 46 38 39 61 | GIF87a / GIF89a |
| ZIP (also DOCX, XLSX, JAR, APK) | 50 4B 03 04 | PK.. |
| RAR | 52 61 72 21 1A 07 00 | Rar!... |
| 7–Zip | 37 7A BC AF 27 1C | 7z… |
| Gzip | 1F 8B | — |
| Bzip2 | 42 5A 68 | BZh |
| TAR | 75 73 74 61 72 at offset 257 | ustar |
| Windows PE (EXE, DLL) | 4D 5A | MZ |
| Linux ELF | 7F 45 4C 46 | .ELF |
| Java class | CA FE BA BE | — |
| WebAssembly | 00 61 73 6D | .asm |
| MS Office 97–2003 (DOC, XLS, PPT) | D0 CF 11 E0 A1 B1 1A E1 | — |
| RTF | 7B 5C 72 74 66 | {\rtf |
| SQLite database | 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 | SQLite format 3 |
| RIFF container (WAV, AVI, WebP) | 52 49 46 46 | RIFF |
| MP3 | FF FB / FF F3 / FF F2, or 49 44 33 (ID3 tag) | — |
| MP4 | … 66 74 79 70 at offset 4 | ftyp |
| Matroska (MKV, WebM) | 1A 45 DF A3 | — |
| Ogg | 4F 67 67 53 | OggS |
| FLAC | 66 4C 61 43 | fLaC |
| BMP | 42 4D | BM |
| TIFF | 49 49 2A 00 / 4D 4D 00 2A | II*. / MM.* |
| Photoshop PSD | 38 42 50 53 | 8BPS |
| PEM certificate or key | 2D 2D 2D 2D 2D 42 45 47 49 4E | -----BEGIN |
The full database behind this tool holds 56 signature entries with their aliases, spanning images, video, audio, documents, archives, executables, databases, fonts, system files, crypto material and disk images.
The security value of a magic header check is that it catches the gap between what a file claims to be and what it is. When the signature and the extension disagree, the tool raises a warning naming both — for example, a file called invoice.pdf whose header reads 4D 5A is a Windows executable wearing a document’s name, which is a classic phishing payload.
Not every mismatch is an attack. Legitimate causes are common:
Content-Type header.50 4B 03 04.That ambiguity is exactly why the tool lists alternatives rather than pretending to a single answer. If your file reports “ZIP archive” with alternatives, the honest reading is “this is a ZIP container” — what is inside it decides the rest.
The corresponding lesson for anyone building an upload feature: never trust the extension, and never trust the client–supplied Content-Type either. Both are attacker–controlled. Validate the magic bytes server–side, then re–encode or sandbox the file. Header validation on its own is also not sufficient, because a polyglot file can carry a valid image header and still be executed as a script by a permissive parser.
In digital forensics, signature analysis is how deleted or renamed files are recovered from unallocated space — file carving works by scanning a disk image for known headers and reconstructing files from them. In incident response, it identifies what an unknown artefact from a compromised host actually is before anything opens it. In CTF competitions, a corrupted or deliberately mislabelled file is a standing forensics puzzle, and repairing the header is usually the first move; the hex editor is the natural companion for editing those bytes, and the hash lookup for checking a sample against known–bad databases.
It is also the everyday explanation for a mundane frustration: an image that will not open, a spreadsheet an application rejects, a “corrupt” archive. Checking the header settles in seconds whether the file is the wrong type, truncated, or genuinely damaged.
It is a short, fixed byte sequence at a known position — usually the very start — that identifies a file’s format. %PDF for PDFs, MZ for Windows executables, PK for ZIP archives. Because it lives inside the file rather than in its name, it survives renaming and is what parsers actually rely on.
PNG is 89 50 4E 47 0D 0A 1A 0A, an eight–byte signature designed to detect corruption during transfer. JPEG starts FF D8 FF followed by a marker byte such as E0 (JFIF) or E1 (Exif). PDF is 25 50 44 46, the ASCII text %PDF, normally followed by a version like -1.7.
No. Files are read in your browser with the File API and analysed locally. Nothing is transmitted or stored, which makes the tool safe for suspicious samples and confidential material.
Only the first 512 bytes of each file are read, since that is where signatures live. That is why a 4–GB disk image checks as fast as a text file — and also why the tool cannot comment on anything beyond the header.
Because a DOCX is a ZIP archive — an Open Packaging Convention bundle of XML parts. The same is true of XLSX, PPTX, JAR, APK, EPUB and ODT. Distinguishing them requires looking at the file names inside the archive, not at the header.
Yes. Headers are just bytes and can be written deliberately. Polyglot files are valid in two formats at once, and attackers use them to slip past validators that only check the first few bytes. Treat a signature check as one strong signal, not as proof.
No signature in the database matched the opening bytes. Usually that means a plain–text or source file — text formats such as CSV, JSON, HTML and most scripts have no magic number at all — or an encrypted, compressed or proprietary format. A file that reports unknown but has a known extension is flagged separately as possibly corrupted or renamed.
Yes. Add a whole batch, then use the Mismatches Only filter to jump straight to the files whose contents contradict their names, and export the results as JSON or CSV.
File magic numbers (file signatures) are byte sequences at the beginning of files that identify file types: Definition: Fixed byte pattern at start of file (typically first 2-16 bytes), used by operating systems to determine file type, independent of file extension. Common magic numbers: (1) JPEG: FF D8 FF (hex), starts every JPEG image. (2) PNG: 89 50 4E 47 0D 0A 1A 0A (hex) or ".PNG" in ASCII. (3) PDF: 25 50 44 46 (hex) or "%PDF" in ASCII. (4) ZIP: 50 4B 03 04 (hex) or "PK" in ASCII. (5) EXE (Windows): 4D 5A (hex) or "MZ" in ASCII. (6) ELF (Linux): 7F 45 4C 46 (hex). Why important: (1) Detect file extension spoofing - Malware disguised as safe file (malware.exe renamed to document.pdf), real type revealed by magic number. (2) Security analysis - Email attachments claiming to be images but are executables, identify hidden file types in forensic analysis. (3) Data recovery - Recover files with corrupted/missing extensions, identify fragments from unallocated disk space. (4) Malware detection - Polyglot files (valid multiple file types), steganography (data hidden in images), obfuscation techniques. (5) Compliance verification - Ensure uploaded files match allowed types, prevent policy violations (uploading executables to document portal). How it works: (1) Read first N bytes of file (header), (2) Compare against database of known signatures, (3) Identify file type regardless of extension. Tools: Unix file command, TrID (File Identifier), this magic number checker, hex editors (HxD, 010 Editor). Real-world example: Email attachment "invoice.pdf" has magic number 4D 5A = Windows executable, victim opens "PDF" and runs malware. File extensions lie, magic numbers don't (unless deliberately crafted).
Extension spoofing exploits user trust in file extensions: Attack technique 1: Double extension - malware.pdf.exe (Windows hides .exe), user sees malware.pdf and thinks it's safe, icon shows PDF icon (can be customized), clicking executes malware. Attack technique 2: Right-to-left override - Unicode character U+202E reverses text display, filename: resume[U+202E]fdp.exe displays as: resume[exe.pdf backward] = resumeexe.pdf, actual file: resume.exe (PDF part is just display trick). Attack technique 3: Renamed executables - malware.exe → document.pdf, if email filters only check extension (not magic number), email delivered as "safe" PDF, user opens with default PDF viewer → error, user "tries again" by running with different program → executes. Attack technique 4: Archive containing executables - compressed_docs.zip contains: report.pdf (legitimate), setup.exe (malware), users extract all files, unknowingly run setup.exe. Attack technique 5: Polyglot files - File that is valid in multiple formats, example: file is both valid JPEG and ZIP, displayed as image in preview, but can be extracted as ZIP containing malware. Detection methods: (1) Check magic numbers - Read first bytes to identify real type, compare with file extension. (2) Deep file inspection - Scan entire file structure (not just header), detect embedded executables, identify suspicious sections. (3) Behavior analysis - Sandbox execution to observe behavior, detect payload extraction/execution. Email security: Modern mail gateways check: magic numbers vs extension, double extensions, RLO characters, macros in Office documents. User protection: (1) Show file extensions (Windows: unhide file extensions), (2) Hover over files to see full path, (3) Check file properties (right-click → Properties → Details), (4) Verify sender before opening attachments, (5) Use antivirus with heuristic detection. Statistics: 45% of malware uses extension spoofing, double extension attacks increased 300% in 2023, most effective against non-technical users. This tool helps verify true file type by examining magic numbers.
Free online hex editor and binary file viewer. Upload a file to view and edit raw bytes in hex/ASCII, inspect int/float/string values with endianness, search hex or text, and export. 100% client-side.
Inspect PE, ELF, Mach-O, universal binaries, and Unix archives with bounded parsers, sections, imports, exports, mitigations, signatures, and suspicious regions.
Extract deep metadata from any file: EXIF data and GPS coordinates from photos, PDF document properties, audio ID3 tags and album art, Office document metadata (DOCX, XLSX, PPTX), and SHA-256 hashes. All processing happens locally in your browser.
Free Shannon entropy calculator for malware analysis. Detect packed, encrypted, or obfuscated binaries with entropy visualization, byte distribution analysis, and section-by-section scanning.