HandyTools Hub

MIME Type Lookup

Look up MIME types by file extension.

Your data never leaves your browser

Showing 0 of 0 entries

Extension MIME Type Category Description Copy

MIME Type Lookup is a fast reference for finding the correct Content-Type value for a file. Search by extension, filter by category, or paste a MIME string to see what it means. It is aimed at web developers, backend engineers, and anyone debugging file uploads, downloads, email attachments, or CDN headers.

How to Use

  • Type an extension such as webp or a full type such as video/mp4 into the search box; results narrow as you type.
  • Filter by category to narrow the table to Text, Image, Audio, Video, Document, Archive, or Font.
  • Read the description column when a type name alone is ambiguous.
  • Click any row’s copy button to put the exact MIME string on your clipboard.
  • Clear the search and category to see the full embedded database.

Why the Content-Type Header Decides Everything

When a server responds, the browser reads the Content-Type header before it decides what to do with the body. text/html is parsed as a page; text/css is applied as a stylesheet; text/javascript is executed as a module; application/octet-stream is offered as a download. Get the value wrong and the browser makes the wrong call. The classic symptoms are a stylesheet served as text/plain that leaves the page unstyled, a .js file served with the wrong type that a module import refuses to load, and an image served as octet-stream that downloads instead of rendering.

When the header is missing or generic, browsers fall back to MIME sniffing: they inspect the leading bytes and guess. Sniffing rescues many misconfigured sites, but it is also a security risk, because a file that looks like JavaScript could be executed after being uploaded as an image. Servers defend against this with X-Content-Type-Options: nosniff, which tells the browser to trust the declared type and stop guessing. Text types also carry a charset parameter; if the declared charset disagrees with the actual bytes you get garbled characters, and for module scripts the browser may refuse the file outright.

Reading a MIME Type

A MIME type has the shape type/subtype, optionally followed by parameters:

text/html; charset=utf-8

  • type is the broad family: text, image, audio, video, application, font.
  • subtype names the format: html, png, json, vnd.openxmlformats-officedocument....
  • parameters refine it, most often charset for text or codecs for media.
  • structured suffixes such as +json or +xml mark a document type built on a generic format.

A structured suffix lets generic tools keep working. For example, application/manifest+json is JSON with a specific meaning, so any consumer that understands application/json can read it too. The x- prefix, by contrast, means the type was never formally registered: application/x-yaml and application/x-tar are familiar examples. Treat x- values as widely accepted conventions rather than standards, and expect a registered replacement to appear eventually.

Types That Trip People Up

ExtensionCorrect typeCommon mistake
.jstext/javascriptapplication/javascript (legacy but widely accepted)
.jsonapplication/jsontext/json, which is not registered
.svgimage/svg+xmlimage/svg, which is invalid
.xmltext/xmlassuming one canonical form; application/xml is also used
.icoimage/x-iconimage/vnd.microsoft.icon for newer IANA registration
.gzapplication/gzipapplication/x-gzip (legacy)
.webpimage/webpomitting the image/ prefix
.mdtext/markdownassuming text/plain; text/markdown is registered
.wavaudio/wavaudio/wave or audio/x-wav in some legacy tools
.7zapplication/x-7z-compressedapplication/7z, which is not a real type

Worked Examples

  • A CSS file is being served as text/plain, so the site renders without styles. Looking up css confirms the correct value is text/css; setting that header fixes every page at once.
  • A file input accepts only PDFs. The tool returns application/pdf, which goes into accept="application/pdf" so renamed .txt files are rejected too.
  • An upload to S3 arrives with no type. The lookup shows the expected MIME for the extension, letting you set ContentType on the presigned PUT so the object is served correctly later.
  • A YAML config is returned as application/octet-stream, so it downloads instead of opening in the browser. The lookup shows application/x-yaml, which most editors accept, while a newer API might prefer the registered application/yaml.

Accuracy and Limits

The database holds a curated set of 40-plus common types, not the full IANA registry. Lookup by extension uses substring matching, which is convenient but can return unrelated entries for very short queries. Lookup by MIME type strips any parameters after a semicolon and matches exactly. Browser behaviour is not part of the data: a correct type is necessary for standards compliance but does not guarantee every browser renders a given format, because codec support still varies. Nor does the tool know your server configuration. Static hosts and CDNs infer types from file extensions and are usually right, but custom extensions such as .avif or .webmanifest sometimes need an explicit rule because their types are newer than the host’s default map.

  • HTTP Status Reference — pair the right Content-Type with the right status code.
  • JSON Formatter — validate a payload before serving it as application/json.
  • Base64 — encode binary data for Content-Transfer-Encoding in email.

Frequently Asked Questions

Why is text/javascript preferred over application/javascript?

Both work in browsers, but IANA registered text/javascript as the standard type for JavaScript in 2022, so it is the current correct value. The older application/javascript still appears in tutorials and frameworks. If you return one of them with the wrong charset, a module script can refuse to execute.

Why does Chrome render a file even when the Content-Type is wrong?

Browsers perform MIME sniffing: if the declared type is missing or generic, they inspect the bytes and guess. Sending X-Content-Type-Options: nosniff disables that guessing, which is why servers that want strict behaviour add the header.

What MIME type should an HTML file input accept?

Use value-based types for precision, such as accept="application/pdf" or accept="image/*,application/pdf". The accept attribute also understands extensions like .pdf, but a MIME type survives a renamed file, and that is usually what you want for validation.

Why is .yaml listed as application/x-yaml?

The x- prefix marks an unregistered, de facto type. application/x-yaml is what many tools emit, while the newer RFC 9512 registers application/yaml. This lookup lists the widely encountered x- form so you recognise it in the wild.

Does the search match partial strings?

Yes. The search box matches substrings across extension, MIME type, and description, so typing mp returns both mp3 and mp4, and js also surfaces json because json contains those letters. Browse by category when you want an exact list.

Can I copy a MIME type together with its charset?

The copy button copies only the type/subtype, such as application/json. For text formats served over HTTP you usually need to append the parameter yourself, for example text/html; charset=utf-8.

Reviewed by the HandyTools Hub team · Last updated