Dev tools

MIME type lookup

Look up the MIME type for a file extension, or the extensions for a MIME type. A common-cases table, not the full IANA registry. Runs on your device.

Runs on your device. The file is never uploaded.

MIME type lookup maps a file extension to its media type, and a query containing a slash runs the other way. About sixty extensions are listed, covering documents, images, audio, video and fonts, with .json as the default query. Only the text you type is read, so a .png name holding JPEG bytes still reports image/png.

Options

Questions

Can I look up both directions?

Yes, and the direction comes from your query. Anything containing a slash is treated as a MIME type and returns every extension in the table that maps to it, so image/jpeg gives .jpg, .jpeg. Anything else is treated as an extension, with or without a leading dot, so png and .png both give image/png.

Is this the full IANA registry?

No. It is a table of common cases, around sixty extensions covering text, code, archives, Office documents, images, audio, video, fonts and a few binaries. The real registry runs to thousands of entries. Anything outside the table is refused rather than guessed, with a message saying the extension is not in this tool's table.

Why did my extension come back unknown?

Because it is not one of the entries. The lookup is an exact match on the lowercased extension, so a typo, a rare format or a double extension such as .tar.gz all miss; for that one, look up .gz. The error quotes the extension it tried, with a leading dot added even if you left it off.

Does it inspect the file itself?

No, it only reads the text you type. A file named .png whose bytes are a JPEG will still report image/png here, because the name is all it sees. If you need the type from the content, use the file type detector, which reads the leading magic bytes instead of trusting the name.

Which type does it give for .js?

text/javascript, the current registered type; the older application/javascript is not in the table. .mjs maps to the same value. Reverse lookups follow from that, so querying text/javascript returns .js, .mjs, while querying application/javascript is refused as a type with no known extension in this tool's table.

Related Dev tools