How to Detect an Image Format
Add your image file
Drag any image onto the drop area or click Choose Image to pick a file. Files such as JPEG, PNG, GIF, WebP, BMP, TIFF, HEIC, HEIF, AVIF, PSD, and SVG are all recognized from their binary signature, not the file name.
Let the header read run in your browser
The tool reads only the first 32 bytes of the file with the FileReader API and compares them against known magic byte signatures. It then loads the image to measure pixel dimensions. Everything happens on your device, so nothing is uploaded to a server.
Review the detected details
Read the true format, MIME type, canonical file extension, file size, dimensions, transparency support, and color depth. If the bytes do not match any signature the format shows as Unknown, while size and any readable dimensions are still listed.
Magic Byte Signatures by Format
Detection is based on the fixed bytes at the start of each file. The table below lists the leading signature this tool matches and how transparency is reported for each format.
| Format | Leading bytes (hex) | MIME type | Transparency |
|---|---|---|---|
| JPEG | FF D8 FF | image/jpeg | No (reported as 24-bit, no alpha) |
| PNG | 89 50 4E 47 | image/png | Read from IHDR color type (4 or 6 = yes) |
| GIF | 47 49 46 | image/gif | Yes, via transparent color index |
| WebP | 52 49 46 46 ... 57 45 42 50 | image/webp | Possible, depends on the variant |
| HEIC / AVIF | ftyp box brand at bytes 8-11 | image/heic, image/avif | Possible, depends on the file |
| SVG | 3C 73 76 67 or 3C 3F 78 6D | image/svg+xml | Yes (vector, alpha supported) |
When This Tool Helps Most
A renamed file will not open
If an app rejects image.jpg or shows a broken thumbnail, the real format may differ from the extension. Reading the magic bytes tells you whether the content is actually PNG, WebP, or something else so you can rename or convert it correctly.
Identifying HEIC on Windows
When a browser cannot preview a HEIC file, header detection still works because it reads the ftyp box brand without decoding the image. The format badge reports HEIC, HEIF, or AVIF even if dimensions show as unavailable.
Checking transparency before editing
For PNG the tool reads the IHDR color type to confirm a real alpha channel, and it flags GIF, WebP, TIFF, and HEIC cases where transparency is possible. Useful before placing an image over a colored background.
Confirming color depth
PNG depth is read precisely from the header. JPEG is reported as 24-bit, and WebP, HEIC, TIFF, and AVIF show a typical range. Helpful when you need to know whether a file is 8-bit or HDR-capable before processing.
Common Problems and Fixes
Format shows as Unknown
The first bytes did not match any known signature. This happens with rare or proprietary formats, truncated downloads, or files that are not images at all. The file name, size, and any dimensions the browser can read are still displayed for reference.
Dimensions say could not be determined
The format was identified from its header, but your browser could not decode the pixels to measure width and height. This is common for HEIC, HEIF, TIFF, or PSD files. The detected format and MIME type remain accurate even without dimensions.
Transparency reads as Possible
For WebP, HEIC, HEIF, AVIF, and TIFF the presence of an alpha channel depends on the specific file and is not fixed by the format. The tool reports Possible rather than guessing. Only PNG and GIF return a definite Yes or No here.
Detected format differs from the extension
That is the tool working as intended. The extension is just part of the file name and can be changed freely, while the magic bytes reflect the real content. Trust the detected format and rename or convert the file to match if needed.