Detect file formats by analyzing file headers and content. Upload any file to identify its format, type, and detailed information.
Features
- Detect file formats by analyzing file headers and magic numbers.: Analyze the first bytes (magic numbers) and validate against a curated signature database to accurately identify formats.
- Support for hundreds of different file formats and types.: Covers images, videos, audio, documents, archives and executables with continuous signature updates.
- Display file header in both hexadecimal and ASCII format.: Visualize headers in hex/ASCII for inspection, debugging and forensic verification.
- Provide detailed file information including size and extension.: Show filename, size, extension, detected format and MIME type; highlight extension–signature mismatches.
Usage Guide
- Step 1: Click 'Load File' to select any file from your computer.
- Step 2: The tool will analyze the file header and content to determine the format.
- Step 3: View detailed information about the file format, type, and properties.
Technical Details
Magic Numbers and File Signatures
File format detection relies on magic numbers (file signatures) - unique byte sequences at the beginning of files identifying their type. Each file format has specific magic bytes: JPEG starts with FF D8 FF, PNG with 89 50 4E 47 (\x89PNG), GIF with 47 49 46 38 (GIF8), PDF with 25 50 44 46 (%PDF), ZIP with 50 4B 03 04 (PK\x03\x04). The tool reads the first 512 bytes of a file and matches patterns against a comprehensive magic number database.
Detection Algorithm and Header Analysis
The detection process uses multi-stage analysis: binary file reading (FileReader API reading file as ArrayBuffer), byte array conversion (Uint8Array for efficient byte manipulation), signature matching (comparing first N bytes against known patterns), and fallback detection (content analysis if header unrecognized). Header analysis includes: hex representation (displaying bytes as hexadecimal for technical inspection),
Applications in Security and Data Recovery
File format detection serves critical roles: security analysis (detecting malicious files masquerading as safe formats, identifying executables with document extensions), data recovery (identifying file types in unallocated disk space, recovering files without extensions), forensic investigation (analyzing unknown files, verifying file integrity), and content filtering (blocking specific file types, validating uploads).
Frequently Asked Questions
- Does the tool upload my files to the server?
- No. All detection runs locally in your browser. Files are not uploaded.
- Why is the detected format different from the file extension?
- Extensions can be renamed. The detector trusts magic numbers (content) more than extensions.
- How accurate is detection for polyglot files?
- Polyglot files may match multiple signatures. We show the most confident match; review headers if in doubt.
- What is a magic number (file signature)?
- A unique byte sequence at the file start that indicates its format, e.g., JPEG FF D8 FF, PNG 89 50 4E 47.
- Can I use this for security checks in production?
- Yes, but enforce server-side validation as well and combine with MIME checks and content scanning.
Related Documentation
- File Signatures Database - Magic Numbers - Comprehensive database of file signatures and magic numbers for format identification
- RFC 6838 - Media Type Specifications - IETF specification for media types and MIME type registration
- MDN - FileReader API - Web API for reading file contents and binary data in browsers
- Wikipedia - List of File Signatures - Extensive list of file signatures and magic numbers for various formats
- TrID - File Identifier - Free file identifier tool using pattern matching for format detection