No Login Data Private Local Save

File MIME Type & Magic Bytes Detector - Online

15
0
0
0

File MIME Type & Magic Bytes Detector

Upload any file to instantly analyze its magic bytes (file signature), identify the true MIME type, and inspect raw hexadecimal data — all processed locally in your browser.

Drag & drop your file here

or click to browse

File stays on your device

Magic bytes are the first few bytes of a file that uniquely identify its format. They act like a digital fingerprint — for example, PNG images always start with 89 50 4E 47 (hex), which spells ‰PNG in ASCII. PDF files begin with 25 50 44 46 (%PDF), and ZIP archives start with 50 4B 03 04 (PK). These signatures allow operating systems and software to recognize file types regardless of their extension.

MIME (Multipurpose Internet Mail Extensions) types are standardized identifiers used by browsers, web servers, and operating systems to determine how to handle a file. Examples include image/png, application/pdf, and audio/mpeg. Knowing the correct MIME type is crucial for web development, file uploads, API responses, and ensuring files open in the right application.

Browsers often determine MIME types based on file extensions rather than actual file content. If a file has been renamed with the wrong extension (e.g., a PNG image saved as .jpg), the browser may report an incorrect MIME type. Our tool reads the actual magic bytes from the file's binary data, providing a more reliable identification that reflects the file's true format.

Yes, magic bytes can technically be spoofed by manually editing a file's header. However, most legitimate files have accurate signatures. In cybersecurity and digital forensics, magic byte analysis is a first-line method for file identification, but it should be combined with deeper content analysis for complete certainty, especially when dealing with suspicious files.

Some formats use common container structures. For example, DOCX, XLSX, PPTX, JAR, and APK files all start with 50 4B 03 04 because they're all ZIP-based formats. Similarly, WAV, AVI, and WebP share the RIFF container signature (52 49 46 46). In these cases, additional bytes deeper in the file (like WAVE or WEBP identifiers) help distinguish the exact format. Our tool shows all possible matches when the signature is ambiguous.

This tool processes everything locally in your browser using JavaScript's FileReader API. Your file never leaves your device — no upload to any server occurs. You can also use command-line tools like file (Linux/Mac), hex editors like HxD (Windows), or the xxd command to inspect magic bytes locally.

Key signatures to recognize: PNG = 89 50 4E 47, JPEG = FF D8 FF, GIF = 47 49 46 38, PDF = 25 50 44 46, ZIP/DOCX = 50 4B 03 04, MP3 = FF FB or 49 44 33, MP4 = ...ftyp at offset 4, ELF = 7F 45 4C 46, and Windows EXE = 4D 5A. See the reference table below for a comprehensive list.
Common File Signatures Reference
40+ formats
Format MIME Type Extension Magic Bytes (Hex)
PNGimage/png.png89 50 4E 47 0D 0A 1A 0A
JPEG / JPGimage/jpeg.jpgFF D8 FF
GIFimage/gif.gif47 49 46 38 (GIF8)
WebPimage/webp.webp52 49 46 46 ... 57 45 42 50
BMPimage/bmp.bmp42 4D
TIFF (LE)image/tiff.tiff49 49 2A 00
TIFF (BE)image/tiff.tiff4D 4D 00 2A
ICOimage/x-icon.ico00 00 01 00
SVGimage/svg+xml.svg3C 73 76 67 (<svg)
HEIF / HEICimage/heif.heic00 00 00 xx 66 74 79 70 68 65 69
PDFapplication/pdf.pdf25 50 44 46 (%PDF)
ZIPapplication/zip.zip50 4B 03 04
DOCX / XLSX / PPTXapplication/vnd.openxmlformats-....docx50 4B 03 04 (ZIP-based)
RARapplication/vnd.rar.rar52 61 72 21 1A 07
7-Zipapplication/x-7z-compressed.7z37 7A BC AF 27 1C
GZipapplication/gzip.gz1F 8B
BZip2application/x-bzip2.bz242 5A 68
XZapplication/x-xz.xzFD 37 7A 58 5A 00
Zstandardapplication/zstd.zst28 B5 2F FD
MP3 (ID3)audio/mpeg.mp349 44 33 (ID3)
MP3 (MPEG frame)audio/mpeg.mp3FF FB / FF FA / FF F3
MP4video/mp4.mp4...66 74 79 70 (ftyp at offset 4)
WAVaudio/wav.wav52 49 46 46 ... 57 41 56 45
AVIvideo/x-msvideo.avi52 49 46 46 ... 41 56 49 20
FLVvideo/x-flv.flv46 4C 56 01
OGGaudio/ogg.ogg4F 67 67 53
MKV / WebMvideo/x-matroska.mkv1A 45 DF A3
HTMLtext/html.html3C 68 74 6D 6C / <!DOCTYPE
XMLapplication/xml.xml3C 3F 78 6D 6C
JSONapplication/json.json7B / 5B (starts with { or [)
SQLiteapplication/x-sqlite3.sqlite53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
ELF (Linux binary)application/x-elf.elf7F 45 4C 46
EXE / DLL (Windows)application/vnd.microsoft.portable-executable.exe4D 5A (MZ)
Mach-O (macOS)application/x-mach-binary.mach-oCA FE BA BE / FE ED FA CE
ISO 9660application/x-iso9660-image.iso43 44 30 30 31 (at offset 32769)
Tarapplication/x-tar.tar75 73 74 61 72 (ustar at offset 257)
WASMapplication/wasm.wasm00 61 73 6D
DEX (Android)application/x-dex.dex64 65 78 0A
CLASS (Java)application/java-vm.classCA FE BA BE