Magic Bytes Detector
Detect file types by analyzing magic bytes (file signatures).
About Magic Bytes Detector
The Magic Bytes Detector identifies file types by reading and matching the leading bytes of a file against a comprehensive database of known file signatures (magic numbers) — the unique byte sequences at fixed offsets that authoritatively identify a file's format regardless of its name or extension. This is how the Unix file command works and how antivirus engines, web application firewalls, and forensic tools perform format detection. The tool recognizes over 500 file signatures including executables (PE, ELF, Mach-O), archives (ZIP, TAR, 7z, RAR), images (JPEG, PNG, GIF, WebP), documents (PDF, DOCX, XLSX), and media formats.
How to Use
Upload a file by dragging it onto the upload area or clicking to browse — the tool reads only the first few hundred bytes needed for magic byte matching without loading the entire file into memory. Alternatively, paste hex bytes directly into the hex input field to look up their file type without having the actual file. Results show the detected format name, MIME type, standard file extension, matched byte pattern, and the offset at which the signature was found.
Common Use Cases
- Security analysts triaging uploaded files in web application vulnerability assessments by checking that file type validation relies on magic bytes rather than extension or Content-Type header which can be trivially spoofed
- Malware analysts identifying the true file type of suspicious binary samples — like executables renamed with .pdf or .jpg extensions — by checking actual magic bytes before opening in an isolated analysis environment
- Backend developers implementing server-side file upload validation that correctly rejects disguised files by checking magic bytes instead of trusting the user-supplied filename extension or MIME type
- Digital forensics investigators identifying file types of fragments recovered from disk images, memory dumps, or carved unallocated disk space where filenames and metadata are unavailable
- Data pipeline engineers diagnosing format mismatches in file processing workflows where upstream systems occasionally deliver files in the wrong format by checking incoming file magic bytes before passing them to format-specific parsers