A file type checker that ignores the name
An extension like .pdf is only a label in the file name. Anyone can change it, and it often goes missing or gets mangled when files are downloaded or sent by email. Most formats start with a fixed pattern of bytes, a file signature or magic number, that is far more reliable. This file type checker reads that pattern and tells you what the file really is.
Common file signatures
| Format | First bytes (hex) | As text |
|---|---|---|
25 50 44 46 | %PDF | |
| PNG | 89 50 4E 47 | .PNG |
| JPEG | FF D8 FF | – |
| ZIP, DOCX, XLSX, JAR | 50 4B 03 04 | PK |
| Windows program | 4D 5A | MZ |
| Linux program | 7F 45 4C 46 | .ELF |
The checker knows more than 150 formats: images, audio, video, archives, fonts, documents, databases and executables. For ZIP-based files it looks inside the archive, so a Word document, an Excel workbook, a Java archive and an Android app are told apart. Text has no signature, so text files are analysed instead and recognised as JSON, SVG, HTML, XML, PEM certificates, scripts or plain text, with their encoding.
Extension mismatches
When the content does not match the extension, the result is marked. A PNG saved as .jpg is usually harmless. A program named invoice.pdf is a classic trick to get someone to run malware, so executables with a document or image extension get a red warning. This check is not a virus scanner: a genuine PDF or Word file can still contain harmful content.
When it helps
- Files without an extension from downloads, backups or old disks.
- Attachments that will not open, because they were saved as the wrong type.
- Suspicious email attachments, to see whether a "document" is really a program.
- Developers checking uploads, where the extension and MIME type sent by a browser cannot be trusted.
Large files and privacy
Most formats are recognised from the first few kilobytes, so even very large files are checked quickly. Files are read in your browser and never uploaded.
Related tools: look up an extension in the MIME type lookup, verify a download with the checksum calculator, or encode a file with file to Base64.