In-browser magic-byte file inspector and SHA-256 verifier
Drop or select any file from your device to inspect its first 64 bytes in hexadecimal and ASCII, detect its true format from magic-byte signatures, flag extension spoofing mismatches, and compute its SHA-256 checksum locally—nothing is ever uploaded.
1. Select or drop a file to inspect locally
Drop any file here, or click to choose from your device
100% local inspection via FileReader & Web Crypto API. Zero bytes leave your browser.
Waiting for a local file selection…
2. Detected signature & integrity report
| File name | — |
|---|---|
| Exact size | — |
| Declared extension & MIME | — |
| Magic-byte signature match | — |
| Extension vs. bytes check | — |
| SHA-256 digest | — |
First 64 bytes hex dump (offset · hexadecimal · ASCII)
00000000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |Select a file...|Why magic-byte inspection is essential for secure file uploads
When a user selects a file in an HTML <input type="file"> element, the browser populates the File.type property almost exclusively by looking up the filename extension in the operating system's registry—not by reading the bytes inside the file. If an attacker or a buggy client renames payload.png (or an executable script) to avatar.jpg, the browser reports image/jpeg in the Content-Type multipart header even though the file begins with PNG signature bytes (89 50 4E 47 0D 0A 1A 0A).
You can test this exact scenario right now: download wrong-extension-png-as-jpg.jpg from our Broken-File QA Test Set and drop it into the inspector above. The inspector reads the leading 64 bytes via Blob.slice(0, 65536).arrayBuffer(), identifies the 89 50 4E 47 PNG signature, and flags the mismatch against the .jpg extension.
Common multi-format container signatures to watch for
- ZIP-based formats (
50 4B 03 04): Standard.ziparchives, Office OpenXML documents (.docx,.xlsx,.pptx), OpenDocument files (.odt,.ods,.odp),.epube-books, and Android.apk/ Java.jarpackages all start with50 4B 03 04. Distinguish them by inspecting the internal filenames or the uncompressedmimetypeentry at offset 30. - RIFF-based formats (
52 49 46 46): WAV, AVI, and WebP all begin with ASCIIRIFFat bytes 0–3; their specific format identifier sits at bytes 8–11 (WAVE,AVI, orWEBP). - ISO Base Media formats (
ftypat bytes 4–7): MP4, MOV, M4A, AVIF, and 3GP all place the ASCII box typeftypat bytes 4–7 and the specific major brand at bytes 8–11.
Frequently asked questions
- Is my file uploaded to any server when I drop it into the File Inspector?
- No. The inspector reads the file directly from your local disk memory using the browser's FileReader / Blob.slice() and Web Crypto APIs. You can disconnect from the internet after loading this page and the inspector will continue to work identically.
- What is the largest file the inspector can hash with SHA-256 in the browser?
- Header magic-byte inspection works on files of any size (even multi-gigabyte files) because it slices only the first 64 KB. Full-file SHA-256 hashing in browser memory is enabled for files up to 64 MB to keep tab memory usage responsive.
Operational transparency, verification and developer reference
For technical questions or feedback regarding SampleTestFiles, contact contact@sjwebtechwork.com. Every sample file, dataset, and diagnostic utility on this site follows strict reproducibility and privacy rules:
- Zero server-side file storage of visitor inputs: When you use our File Generator, Test Data Generator, Magic-Byte File Inspector, Browser Support Checker, or Developer Tools, all computation runs inside your browser's local JavaScript engine and Web Workers. No files or form inputs are transmitted to our servers.
- Deterministic provenance and public-domain licensing: All hosted fixtures under
/pub-files/and/mock-data/are synthesized from mathematical test patterns, sine waves, and invented records under our CC0 / Public Domain Licence and documented with exact commands on Methodology. - Cryptographic verification: Every file is accompanied by its exact byte length and 64-character SHA-256 digest, listed in our SHA-256 Checksum Directory, /checksums.txt, and /files.json.