How to Identify a File Type (Read the Bytes, Not the Name)
An extension is a claim and the magic number is evidence. When they disagree, the bytes win — which is why upload validation that trusts the extension is no validation at all.
Choose a file. The first bytes are read and matched against known signatures, with a mismatch reported explicitly.

Workflow Lifecycle & Pipeline
Visual execution flow showing how File Type Identifier processes data directly in your local browser sandbox.
File Type Identifier Interactive Process Pipeline
Fast, zero-latency execution directly in your browser memory.
Before You Start
Ensure your source assets and browser environment meet the verified execution requirements.
Step-by-Step Instructions
Follow these verified steps to execute the task with File Type Identifier.
Add your PNG code
Open File Type Identifier and drop your code onto the page, or pick it from the file dialog. It reads PNG, JPG, PDF, ZIP, MP4 or TXT.
snippet.pngPress Read the Magic Number
Read the Magic Number starts the work in this tab. Nothing is uploaded, so how long it takes is down to your own device.
Read the Magic NumberFile Type Identifier runs on your deviceDownload the TXT
The result appears with a download button, as TXT. It was made on your device, so nothing has to be cleaned up afterwards.
Under the Hood: Sandboxed WASM Execution & Isolated Web Workers
Development tools and code sandboxes execute inside sandboxed Web Workers with isolated thread runtimes. Code scripts cannot access DOM scopes, cookies, or local network interfaces, providing high security and bare-metal performance.
Real-Time Stdin Stream
Interactive inputs pipe directly into std::cin, sys.stdin, and ReadLine buffers via simulated virtual teletypes.
Zero Egress Guarantee
Algorithm logic, API keys, and test queries remain confined to the client virtual machine.
Near-Native CPU Performance
Precompiled WebAssembly modules execute with near-native JIT performance on V8 and SpiderMonkey engines.
Best Practices & Key Considerations
Avoid common quality pitfalls and maximize output performance.
Expert Recommendations
- Renaming a file changes nothing about its contents. A program that trusts the name fails confusingly; one that reads the bytes works anyway.
- Text formats have no magic number by design — CSV, JSON, HTML, SVG and source code are defined by their content. 'No signature' on mostly-printable bytes is the correct answer, not a failure.
- PK\x03\x04 is a ZIP — and a DOCX, XLSX, PPTX, EPUB, JAR and APK, because all of those ARE ZIP archives. Rename a .docx to .zip and you can read the XML inside.
- The browser's reported type comes from the operating system's extension mapping, not the contents. It is the same claim repeated, not independent confirmation.
- If you accept uploads, validate the content and never the extension — the extension is the one thing an uploader fully controls.
Common Mistakes to Avoid
- Giving it a format it does not read — PNG, JPG, PDF, ZIP, MP4 or TXT are the ones it takes.
- Selecting several files at once; File Type Identifier works on one per run.
- Waiting for an upload that never happens — File Type Identifier runs in this tab, so the file stays on your device.
Troubleshooting & Fixes
Quick solutions for common browser constraints, format issues, and edge cases.
Troubleshooting & Common Issues
File Type Identifier will not accept the file
Possible Cause: File Type Identifier reads PNG, JPG, PDF, ZIP, MP4 or TXT and nothing else.
Only one of several files comes back
Possible Cause: File Type Identifier handles one file per run.
Frequently Asked Questions
Everything you need to know about formats, privacy, and browser support.
Related Step-by-Step Guides
Explore companion workflows, optimization techniques, and verified tutorials.