MIME type lookup by file extension

Useful when configuring a server, handling uploads or sending attachments, so browsers open the file the right way.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter extension or file name.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The part after the last dot is matched against a table of IANA-registered media types and common x- types. text types get charset=utf-8 in the header example.

Example

Inputs: Extension or file name = pdf. Result: MIME type: application/pdf; Category: Application or document; Registration: IANA registered.

pdf
application/pdf

Limits and caveats

  • Covers about 70 common types, not the full IANA registry.
  • An extension does not guarantee the content; check the real bytes when accepting user uploads.

Questions about this tool

Is JavaScript application/javascript or text/javascript?

RFC 9239 makes text/javascript the current type; application/javascript is obsolete.

What should I use for an unknown file?

application/octet-stream, which browsers treat as a download.

Why does my SVG show as text?

Usually the server sends the wrong type. The correct one is image/svg+xml.