MIME Type Lookup: Extension, Header & Server Snippets

Developers reach for this page when a browser refuses a file, a proxy rewrites a header, or a static host serves a font with the wrong type. Type an extension or a media type into the combined box, parse a copied Content-Type header, or take a ready-made server line. All four blocks read one table, so an extension, a header, and a snippet always agree. The table bundles the common web, media, office, and archive types, so most lookups finish here.

MIME Type, Header, and Snippet Lookups

Combined lookup

A slash sends the value down the type path, and anything else is read as an extension. Results list the canonical type first.

Live search

Type a fragment of a type, an extension, or a kind. Fifteen rows show as you type, each with extension, type, kind, and payload flag.

Content-Type header parser

Paste the value without the field name. The type, each parameter, and the charset verdict follow, with a note when charset is missing.

Server snippet

Pick a server, enter an extension, and copy the line printed for that server. The lookup finds the entry first, so the type stays correct.

 

How It Works

A media type is written as type/subtype, and that pair is what goes into the Content-Type header: image/png, text/html, application/json. Everything after the first semicolon is a parameter, a key=value pair such as charset=utf-8 or boundary=----batch, and quoted values appear when a value holds a semicolon. A structured suffix on the subtype, as in application/ld+json, announces JSON inside a documented envelope. Registered names are lowercase by convention, so Image/PNG and IMAGE/png reach the same row.

Charset applies only to payloads read as characters. A text response without one leaves the client guessing, and a wrong guess turns accented characters into garbage while the same page looks fine elsewhere. JSON is specified as UTF-8, yet intermediaries assume Latin-1 when the header stays silent. Multipart bodies carry charset values per part, so one message can mix encodings. Declaring charset=utf-8 costs a few bytes and ends the guess.

Every row carries a kind and a binary flag, decided by one rule set: text/*, message/*, multipart/*, image/svg+xml, and types ending in +json or +xml read as text, while images, audio, video, fonts, and archives read as bytes. That flag drives the header verdict and the charset suggestion. Snippet output follows the chosen server: a types block for nginx, AddType lines for Apache, mimeMap entries for IIS. Servers that ship a default map often lose custom lines during a version upgrade.

Older servers still send names that were never registered, such as image/jpg or audio/mp3. The table keeps those in an alias map, so typing one shows the registered type it stands for. Some extensions legitimately map to more than one type, which is why the js lookup prints two rows instead of picking one.

Before and After

Two runs of the widget, one started from a file name and one from a copied header. The left side shows what you begin with, and the right side shows the printed result.

Before (a file name and a copied header)
file: brand.woff2
type: font/woff2 (font, binary)
exts: woff2

nginx:
types {
  font/woff2  woff2;
}
After (what the widget prints)
header: Content-Type: application/json; charset=utf-8
type: application/json
params: charset = utf-8
verdict: textual, charset declared

Use Cases

Situation Where it shows up What to check
Upload rejected with 415 Unsupported Media Type API gateways and multipart endpoints Compare the sent type with the endpoint allow list
Fonts or WASM files never load nginx, Apache, and IIS default maps Add the missing line from the snippet block, then reload
A proxy or CDN echoes a stale header CDNs, gateways, and browser test suites Paste the observed header into the parser block

Common Mistakes

  • Sending JSON with no charset, or with charset=ISO-8859-1, when the payload holds UTF-8 characters such as names and addresses.
  • Treating every application/* value as binary, even though application/json, application/xml, and application/graphql are read as characters.
  • Trusting only the file extension, because a file named report.pdf that really holds CSV still gets application/pdf from the server map.
  • Pasting a whole header line into the parser box, so the field name lands inside the parsed type.
  • Writing image/jpg or audio/mp3 into client code when the registered names are image/jpeg and audio/mpeg.
  • Declaring text/plain for a file meant to download, since many browsers open it inline instead of saving it.

Best Practices

  • Declaring charset on every text response, JSON included, so no client has to pick an encoding on its own.
  • Sending X-Content-Type-Options: nosniff when the declared type is the one the client should trust for that route.
  • Matching Content-Length to the bytes actually written, because a mismatch truncates downloads in some clients and test tools.
  • Keeping one mapping source, so server config and application code report the same type for the same file.
  • Re-parsing the served header after every config change, then checking the response in the browser network panel.
  • Listing custom extensions beside the standard ones, so a hand-written types block never drops .css or .js.

Frequently Asked Questions

What is a MIME type?

A MIME type is a type/subtype label such as image/png that tells a client how to read the bytes it received. The label travels in the Content-Type header and in server config for static files. The kind shown in each row comes from the subtype name. A wrong label shows a broken page or a blocked upload.

How do I look up an extension?

Type the extension with or without a leading dot and press the button. The table matches every registered extension, so js returns both text/javascript and application/javascript instead of one answer. Alias names such as image/jpg resolve to the registered entry. Each row shows the canonical type, its kind, the textual or binary flag, and the full extension list.

Why does charset matter?

A charset names the character encoding, so it only applies when the payload is text. A missing charset forces the browser to guess, and a wrong guess renders accented characters as garbage. The parser prints a suggested value whenever the type is textual. JSON is defined as UTF-8, yet proxies still assume Latin-1 unless the header says otherwise.

What does textual versus binary mean?

Textual means the bytes can be read as characters: text/*, message/*, multipart/*, image/svg+xml, and any type ending in +json or +xml. Everything else counts as binary and should move as opaque data with an accurate length. The flag comes from one rule set, so every block on this page agrees.

Which Content-Type should JSON use?

Send application/json, which is the registered name most clients expect. Adding charset=utf-8 is harmless and helps older intermediaries that would otherwise assume Latin-1. Avoid unofficial names such as text/json, because strict parsers reject them. For JSON Lines, application/x-ndjson is the better fit, and the charset stays the same.

How do I add a type a server ignores?

Choose a server in the snippet block, enter the extension, and press the button. nginx receives a types block, Apache receives AddType lines, and IIS receives mimeMap entries for web.config. The printed output uses the canonical type for that extension. Paste the output into that server mapping file, reload, and parse a served header to confirm.

Does any input leave the browser?

No. All four blocks read a table bundled into the page, so nothing you type is transmitted. There is no network call, no storage, and no log of the extensions or headers you check. Nothing is cached between lookups either, and closing the tab discards every value.