MIME Type Checker and File Type Identifier
Check a file's MIME type from its magic bytes, and identify its format, usual extension, category and size, whatever the filename says.
Runs in your browser — your input is processed on this device and never uploaded.
Input
Result
Results appear here.
About this tool
On this page
What is a MIME type?
A MIME type is the short label that says what kind of data a file holds: image/png, application/pdf, text/csv. Browsers, mail clients, and APIs read it to decide whether to display something, download it, or refuse it. A filename extension is a guess at the same answer, and the two disagree more often than you would like.
This tool works the answer out from the bytes instead.
How to use the MIME type checker
- File
- Upload the file to identify. It is the only input, and there is nothing to configure.
- Recognized
- Whether the contents matched a known format at all. The result turns green when they did, and yellow when it fell through to a generic binary result.
- Format
- The readable name of the format.
- MIME type and Extension
- The type string, and the extension that format normally uses.
- Category
- The broad bucket, such as image, document, archive, audio or video.
- Size
- The exact byte count, and the same number in readable IEC units.
Why detect a file type from its bytes
An extension is just the end of a filename. Rename report.exe to report.jpg and not one byte of the file changes, so anything trusting the name is now wrong about it. The Content-Type sent with an upload has the same weakness, and it comes from the client, which can set it to anything at all.
Reading the bytes sidesteps both. Formats announce themselves in their opening bytes, known as magic bytes or the file signature: a PDF starts with %PDF and a ZIP with PK. The file describes itself, and a rename cannot lie on its behalf.
That matters when an upload pipeline rejects files it should accept, when a download opens in the wrong application, when you inherit a directory of files with missing or wrong extensions, or when you want to know what something is before opening it.
MIME type detection alternatives
Going by the extension is free and correct most of the time. It is fine for sorting your own files and a poor basis for anything that accepts uploads from other people. The Content-Type header is just as cheap and fails the same way, with the added problem that it is supplied by whoever is doing the uploading.
Inspecting the leading bytes is what happens here, and it is how the Unix file command has worked for decades. It costs a read of the file and gets you an answer the filename cannot fake.
Format-specific validation is a different job and often the one you want next. Recognizing a file as CSV says the bytes look like CSV, not that the columns line up. Run it through CSV Validator for that.
Things to know about MIME detection
Detection reads at most the first 64 KiB. Formats identify themselves early or not at all, so there is no reason to walk a multi-gigabyte video to the end.
Container formats are the awkward case. DOCX, XLSX, EPUB and APK all share the same outer wrapper, so their opening bytes look alike and telling them apart takes a further look inside. This tool distinguishes them.
Unknown data is not an error. Anything matching nothing comes back as a generic binary result with Recognized set to false, which is a useful answer in itself.
Warning
This identifies a file, it does not vet one. It is not a malware scan, and a recognized format is not therefore a safe or a valid file.