File Type Detector
Identify file types from magic bytes — fully client-side, file never leaves the browser
Identify file types from magic bytes — fully client-side, file never leaves the browser
Detection runs entirely in your browser — only the first 512 bytes of the file are read, and nothing is uploaded. You can drop confidential or production files here without exposing them.
The matcher walks a hand-curated table of magic-byte signatures: images (PNG, JPG, GIF, WebP, AVIF, HEIC, BMP, TIFF, ICO), documents (PDF), media (MP4, MOV, MP3, WAV, OGG, FLAC), archives (ZIP, 7z, RAR, gzip, tar), fonts (WOFF, WOFF2, TTF, OTF), and binaries (SQLite, WASM, ELF).
File extensions lie. Anyone can rename invoice.pdf to invoice.png and most upload forms will happily accept it. The only reliable way to know what a file actually is is to inspect its first few bytes — a short, well-known prefix that the format designers reserved as a signature. PNG starts with 89 50 4E 47, PDF with %PDF, ZIP with PK\x03\x04, and so on. These are usually called magic bytes or file signatures.
Most server-side validation libraries do this too, but doing it in the browser before upload saves a round-trip and lets you give immediate feedback. It also lets a tool like this one work on files you would never want to upload — production database dumps, signed binaries, customer attachments.
.docx, .xlsx, .jar, .apk, and .epubare all ZIP files. Magic bytes alone can't distinguish them — you have to peek inside the archive at the manifest.ftyp box at offset 4, with a brand identifier following at offset 8.