MIME Type to Extension Lookup

Enter a MIME type (like image/png) or an extension (like png) to look it up.

How it is calculated

The tool looks your entry up in a built-in table of 42 common types, such as text/html, application/json, image/png, audio/mpeg and video/mp4. Input is trimmed and lowercased first. If it contains a slash it is read as a MIME type and the matching extension is returned with a leading dot. Otherwise it is read as an extension (a leading dot is optional) and the first MIME type in the table with that extension is returned. Each type has one extension, so image/jpeg gives only .jpg. Anything not in the table, including rare types, extensions with aliases such as jpeg or htm, and types carrying parameters like ; charset=utf-8, returns "Not found".

Worked example

Enter image/webp. The text contains a slash, so the tool treats it as a MIME type and looks it up in the table, where it maps to the extension webp. The result is .webp, shown together with the MIME type image/webp. Now try the reverse direction: typing mp3 (or .MP3) has no slash, so it is read as an extension and the tool returns audio/mpeg, the table's entry for that extension.

Try this example →

Common mistakes

  • Pasting a full Content-Type header value such as text/html; charset=utf-8. The tool matches the whole string, so the parameter makes it "Not found"; remove everything from the semicolon.
  • Entering jpeg, htm or tif and expecting a match. Only the primary extensions in the table (jpg, html, tiff) are recognised.
  • Typing a compound extension like tar.gz. It is looked up as one string and is not found; look up gz or tar separately.
  • Treating "Not found" as proof that a type does not exist. The table has only 42 entries, so valid types such as image/avif are missing.
  • Assuming js gives application/javascript. The table returns text/javascript, and application/javascript typed in is not found.

About this calculator

A MIME type (Multipurpose Internet Mail Extensions, formally an “Internet media type” under IANA's registry) is the type/subtype string — like image/png, application/pdf or text/csv — that HTTP responses, email attachments and file uploads use in the Content-Type header to tell a client how to interpret a payload, independent of the filename. This tool looks up the conventional file extension for a given MIME type, or the reverse, from a built-in table of about 40 common types (documents, images, audio, video, fonts and archives) — not the full IANA registry, so an obscure type will show as not found.

Web developers configuring file upload validation, server administrators setting Apache or Nginx MIME type mappings, and API developers handling multipart form data all need this correspondence — a mismatch between the declared MIME type and the actual file extension is a classic source of broken downloads, rejected uploads, or security issues, since some browsers sniff content type differently than the server declares it, and validating both together closes that gap.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators