File Type Detector
Find out what a file really is from its first bytes (PNG, JPEG, PDF, ZIP, ELF, SQLite and dozens more) and whether that matches its extension.
Free · No sign-up · Your inputs stay in your browser
Input
Detect a file's real type from its magic bytes
Output
Choose a file
Only the first 512 bytes are read. The extension and the browser's reported type both come from the file name, which anyone can change; the signature at the start of the file is what the program opening it actually sees. Validate uploads the same way on the server: PHP's finfo_file() and the file command read these signatures.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Extensions lie
A file's name and the browser-reported MIME type both come from the name, which anyone can change. The bytes at the start of the file are what the program opening it reads. Upload validation that trusts the extension accepts a PHP script named avatar.jpg. Check content on the server with PHP's finfo_file(), Python's python-magic or the file command, which use the same kind of signature database.
Containers
DOCX, XLSX, JAR, APK and EPUB are ZIP files with a particular layout, so their signature is ZIP's; telling them apart needs a look inside.