Choose language

MIME Type Checker

Identify the MIME type of any file or URL using magic bytes, file extension, and HTTP headers, covering hundreds of registered content types.

Mehmet Demiray Published Updated
Share
Read in your browser. Nothing is uploaded to a server.

What Are MIME Types

MIME stands for Multipurpose Internet Mail Extensions, a standard that began as a way to label the contents of email attachments so a mail client would know how to handle them. The same labels turned out to be just as useful on the web, where a server needs to tell a browser whether it is sending a web page, an image, or a download. Today a MIME type, also called a content type, is the universal way to declare the format of a piece of data.

The label follows a simple type/subtype structure. The type is a broad category such as text, image, audio, video, or application, and the subtype names the specific format within it, as in text/html, image/png, or application/json. This two-part scheme lets software make quick decisions: a browser renders text/html, displays image/png inline, and prompts a download for an unfamiliar application subtype. Getting the label right is what keeps that behavior predictable.

How Detection Works

The most reliable way to identify a file is to read its magic bytes, the short signature that many formats place at the very start of their data. A PNG image begins with a fixed byte sequence, a PDF starts with a recognizable marker, and a ZIP archive has its own header. Because these signatures live inside the file, they reveal the true format regardless of what the filename claims.

When a signature is missing or ambiguous, the checker falls back to the file extension, which is a hint rather than proof. For URLs, it can also read the Content-Type header the server returns, which states what the server believes it is sending. Combining these sources produces a confidence level: a match between magic bytes, extension, and header gives high confidence, while a conflict flags a file that may be mislabeled. Upload a file or enter a URL, and the tool reports the detected type along with how that conclusion was reached.

Common MIME Types

Most everyday files fall into a small set of familiar types. Knowing the common ones helps you spot a wrong label quickly and configure servers correctly.

Category Example MIME type Typical extension
Image image/png .png
Image image/jpeg .jpg
Document application/pdf .pdf
Web text/html .html
Data application/json .json
Audio audio/mpeg .mp3
Video video/mp4 .mp4

The application type is the catch-all for formats that are neither plain text nor obvious media, which is why JSON, PDF, ZIP archives, and binary downloads all live there. Text formats like HTML, CSS, and plain text sit under text, and media splits cleanly into image, audio, and video. Beyond these, the registry covers hundreds of less common types, but this handful accounts for the large majority of files you will meet on the web.

Why MIME Types Matter

On the web, the Content-Type header decides how a browser treats a response. Send a stylesheet as plain text and the browser may refuse to apply it; send a download with the wrong type and it might try to render binary data as a page. Correct MIME types are what make a server behave the way you expect, so getting them right is a routine part of web configuration.

Security is the other reason they matter. File upload features should not trust the extension a user supplies, since an attacker can rename a script to look like an image. Checking the real type from the file signature lets you accept only the formats you intend to allow. The same accuracy helps with email attachments, where the wrong label can stop a client from opening a file correctly. In each case, verifying the true type rather than guessing from the name prevents both broken behavior and avoidable risk.

When Extension and Type Disagree

A file can absolutely carry an extension that does not match its real format. Renaming photo.png to photo.txt does not change the bytes inside, so the file is still a PNG even though its name now suggests plain text. This happens by accident through careless renaming, and on purpose when someone tries to disguise a file to slip past a filter that only checks the extension.

This is exactly why signature-based detection is worth trusting over the name. The magic bytes describe what the data actually is, while the extension only describes what someone labeled it. When the checker reports a high-confidence type that conflicts with the extension, treat the detected type as the truth and the extension as suspect. For workflows that handle the underlying bytes, you may also want to inspect or transform the file directly, for example with the File to Base64 converter or its reverse, Base64 to File, or verify integrity using the MD5 hash tool.

The ones we answer the most.

What is the difference between a MIME type and a file extension?

A file extension is part of the filename and is only a hint about the format, while a MIME type is a standardized label that describes the actual content as type/subtype. The extension can be changed freely without altering the data, but the true MIME type is determined by the file's contents. That is why detection based on the file's internal signature is more reliable than reading the extension.

How do I find the MIME type of a file?

Upload the file or enter a URL, and the checker reads the magic bytes at the start of the data to identify the format. If the signature is missing or ambiguous, it falls back to the extension, and for URLs it can also read the server's Content-Type header. It then reports the detected type along with a confidence level so you know how certain the result is.

Why does my server send the wrong content type?

Servers map extensions to MIME types using their own configuration, so a missing or outdated mapping can cause the wrong Content-Type header. Common culprits are an unconfigured file extension, a default fallback like application/octet-stream, or a stale server config. Checking the real type of the file and comparing it with what the server returns usually shows exactly which mapping needs fixing.

Can a file have a different MIME type than its extension suggests?

Yes, and it is common. Renaming a file changes only its name, not the bytes inside, so a PNG renamed to .txt is still a PNG. This can happen by accident or deliberately to disguise a file. When the detected type conflicts with the extension, trust the signature-based result, since it reflects what the data actually is.

What does the confidence level mean?

Confidence reflects how well the available signals agree. When the magic bytes, the extension, and any HTTP header all point to the same format, confidence is high. When they disagree, or when a format has no distinctive signature, confidence drops and the result is treated as a best guess. A high-confidence detection is the one to act on.

Why should I not trust the extension for file uploads?

Because the extension is supplied by the user and can be anything. An attacker can rename an executable or script to look like a harmless image, so validating uploads by extension alone is unsafe. Checking the real MIME type from the file signature lets you accept only the formats you actually intend to allow, which closes a common upload security gap.

References

  1. Media Types · IANA
  2. MIME Part Two: Media Types (RFC 2046) · IETF · 1996