01What is Image Format Detector?
A file called logo.jpg is not always a JPEG. Someone renames a PNG, a phone exports HEIC with the wrong extension, or an upload form trusts whatever the browser says. This tool ignores the name and checks the bytes. When you drop a file, it reads the first 4096 bytes in your browser and compares them with known magic numbers. Nothing is uploaded, and the rest of the file is never read. The signatures come from each format's own spec. PNG starts with 89 50 4E 47 0D 0A 1A 0A. JPEG starts with FF D8 FF. GIF starts with the text GIF87a or GIF89a. WebP is a RIFF container with WEBP at bytes 8 to 11. TIFF begins II*\0 or MM\0*, ICO begins 00 00 01 00 and BMP begins BM. AVIF and HEIC need a closer look. Both use the ISO base media file format, the same box layout as MP4 video. The tool finds the ftyp box and reads its brand list. The avif brand means AVIF, heic or a related brand means HEIC, and a plain mif1 means generic HEIF. An MP4 with brands like mp42 and isom is not reported as an image. SVG has no binary signature at all, since it is XML text. It counts as SVG when the root element is <svg>, after an optional XML declaration, comments or a doctype. Here is a typical result. Drop photo.png whose bytes start FF D8 FF. You get JPEG with MIME type image/jpeg, plus the warning that the extension .png does not match the content. The first 12 bytes appear in hex so you can check the match yourself. The same check also catches a browser-reported type that disagrees, and a file with no extension at all. For each format you also see the typical extension, the compression method and badges for transparency, animation and a lossless mode. Below that is a short list of format features. These describe what the format can do, not what your particular file uses. A PNG shows Animation: Yes because APNG exists, even if your file is a still image. Limits are worth stating plainly. The tool reads headers only, so it cannot tell you the dimensions, colour profile or whether a file is corrupt further in. A file with a valid header and broken data will still pass. Anything without a known signature shows as Unknown, along with whatever type your browser reported.
Web developers who validate image uploads and need to see what a file really contains, whatever its name says. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Image Format Detector
- Drop an image onto the upload area, or click it to choose a file.
- Read the detected format, file name and size at the top of the results.
- Look for a warning that the extension or the browser-reported type does not match the content.
- Compare MIME Type and Typical Extension with the hex shown under First 12 Bytes.
- Check the Transparency, Animation and Lossless mode badges and the list under What the format supports.
- Press the reset button to inspect another file.
03Worked examples
- Input:
File photo.png whose first bytes are FF D8 FF - Result:
image/jpeg. Warning: The extension .png doesn't match the content, which is JPEG. - Detection reads the magic bytes, not the file name.
- Input:
File a.jpg, browser reports image/png, bytes start FF D8 FF - Result:
Your browser reports image/png, but the content is JPEG. - Input:
File scan (no extension), bytes RIFF....WEBP - Result:
image/webp. The file has no extension; its content is WebP. - Input:
ftyp box with major brand heic and compatible brands mif1, heic - Result:
image/heic - Input:
ftyp box with brands mp42 / isom (an MP4 video) - Result:
null (not recognised as an image) - Only the brand list separates video from AVIF or HEIC.
- Input:
Bytes RIFF....WAVE (a WAV audio file) - Result:
null (not recognised as an image) - RIFF without the WEBP marker is not treated as WebP.
04Common use cases
- Checking whether an upload your server rejected is really a JPEG or a PNG with the wrong extension
- Looking at real header bytes while writing magic-number validation for an upload endpoint
- Finding out whether a photo from an iPhone is HEIC before sending it to a tool that only takes JPEG
- Telling an AVIF file apart from an MP4 that both start with an ftyp box
- Comparing what WebP, AVIF and PNG support before choosing an export format
- Showing students in a security class why a file extension proves nothing
05Tips
- RIFF alone is not enough to call something WebP. WAV and AVI files are RIFF too, so the tool also requires WEBP at bytes 8 to 11.
- AVIF, HEIC and MP4 share the ftyp header. The brand list after it is what tells them apart.
- On your server, never trust the extension or the Content-Type header alone. Check the signature, then decode the image to be sure.
- SVG is text and can carry scripts, so passing a signature check does not make an SVG safe to serve inline.
- The badges describe the format. A PNG shows Animation: Yes because APNG exists, even when your file has a single frame.
06Related concepts
Magic numbers, File signatures, MIME types, Image formats, Lossless compression.
Frequently Asked Questions
What is Image Format Detector?
Image Format Detector is a free, browser-based developer tool on AIDToolStack. Detect image format by file signature It requires no installation or sign-up and works entirely in your browser.
Is Image Format Detector free to use?
Yes. No sign-up, no fees and no usage cap.
Does Image Format Detector store my data?
No. It runs in your browser; nothing is uploaded.