Home/Tools/File Magic Number Checker

File Magic Number Checker

Identify file types by magic numbers and signatures. Detect file extension spoofing and verify true file formats for security analysis.

Privacy & Security

All file analysis happens locally in your browser using the File API. Your files never leave your device.

📁

Drop files here or click to browse

Supports batch analysis of up to 100 files

Need Professional Security Services?

Our cybersecurity experts can help protect your business with comprehensive security solutions.

References & Citations

  1. Gary Kessler. (2024). List of File Signatures (Magic Numbers). Retrieved from https://www.garykessler.net/library/file_sigs.html (accessed January 2025)
  2. DigitalPreservation.gov. (2024). File Format Specifications. Retrieved from https://www.digitalpreservation.gov/formats/ (accessed January 2025)
  3. NIST. (2022). Forensic File Carving Techniques. Retrieved from https://www.nist.gov/publications/forensic-file-carving (accessed January 2025)

Note: These citations are provided for informational and educational purposes. Always verify information with the original sources and consult with qualified professionals for specific advice related to your situation.

Frequently Asked Questions

Common questions about the File Magic Number Checker

File magic numbers (file signatures) are byte sequences at the beginning of files that identify file types: **Definition:** Fixed byte pattern at start of file (typically first 2-16 bytes), used by operating systems to determine file type, independent of file extension. **Common magic numbers:** (1) **JPEG:** FF D8 FF (hex), starts every JPEG image. (2) **PNG:** 89 50 4E 47 0D 0A 1A 0A (hex) or ".PNG" in ASCII. (3) **PDF:** 25 50 44 46 (hex) or "%PDF" in ASCII. (4) **ZIP:** 50 4B 03 04 (hex) or "PK" in ASCII. (5) **EXE (Windows):** 4D 5A (hex) or "MZ" in ASCII. (6) **ELF (Linux):** 7F 45 4C 46 (hex). **Why important:** (1) **Detect file extension spoofing** - Malware disguised as safe file (malware.exe renamed to document.pdf), real type revealed by magic number. (2) **Security analysis** - Email attachments claiming to be images but are executables, identify hidden file types in forensic analysis. (3) **Data recovery** - Recover files with corrupted/missing extensions, identify fragments from unallocated disk space. (4) **Malware detection** - Polyglot files (valid multiple file types), steganography (data hidden in images), obfuscation techniques. (5) **Compliance verification** - Ensure uploaded files match allowed types, prevent policy violations (uploading executables to document portal). **How it works:** (1) Read first N bytes of file (header), (2) Compare against database of known signatures, (3) Identify file type regardless of extension. **Tools:** Unix `file` command, TrID (File Identifier), this magic number checker, hex editors (HxD, 010 Editor). **Real-world example:** Email attachment "invoice.pdf" has magic number 4D 5A = Windows executable, victim opens "PDF" and runs malware. File extensions lie, magic numbers don't (unless deliberately crafted).

⚠️ Security Notice

This tool is provided for educational and authorized security testing purposes only. Always ensure you have proper authorization before testing any systems or networks you do not own. Unauthorized access or security testing may be illegal in your jurisdiction. All processing happens client-side in your browser - no data is sent to our servers.