induwara.lk
induwara.lkDeveloper · Reference

MIME Type Lookup — File Extension ↔ Content-Type

Get the official MIME type for any file extension — or the extension for any media type — straight from the IANA registry, with copy-ready Content-Type headers. Covers 121 common web, office, and media extensions. No signup, sources cited.

By Induwara AshinsanaUpdated Jun 27, 2026
MIME Type Lookup121 extensions · 85 types
IANA · WHATWG

The direction is detected automatically: type an extension (with or without the dot) for the MIME type, or a type/subtype string for the extension.

Popular

What this does

Look up the official Content-Type for any file extension — or go the other way and find which extension a MIME type belongs to. Every answer comes with a one-click copy button and a ready-to-paste Content-Type header. Try or one of the popular chips above.

Sources cited:IANA Media Types WHATWG MIME Sniffing

How it works

This is a reference tool, not a calculator — so the “method” is the data model and the rules behind it, every record sourced. A single typed module holds 85 curated types covering 121 extensions, each record carrying its canonical type/subtype string, the extensions that map to it, a category, whether it is IANA-registered, and a sourced note where the standard and real-world server behaviour differ.

  1. Normalise. The query is trimmed and lowercased. For an extension a leading *. glob or a single dot is stripped, so .PNG, png, and *.png all resolve the same.
  2. Detect direction. If the query matches the RFC 6838 type/subtype grammar (it contains a / and valid characters) the tool does a reverse lookup (MIME → extension); otherwise a forward lookup (extension → MIME). Parameters after a ; are dropped, so text/html; charset=utf-8 matches text/html.
  3. Forward. The extension indexes directly to its entry. Each extension is claimed by exactly one record, so the answer is unambiguous; where two types historically compete (e.g. .ico), the table records the IANA-registered string and notes the de-facto alternative — the preference order IANA-first, then Apache.
  4. Reverse. The media type matches its canonical string or any recognised alias — application/javascript resolves to the .js entry whose canonical type is text/javascript, per WHATWG.
  5. Fallback. A miss returns application/octet-stream — the generic binary type browsers fall back to for unknown content (WHATWG MIME Sniffing) — plus the closest fuzzy matches.

The registration label comes from the subtype prefix (RFC 6838): no prefix is the standards tree, vnd. is the vendor tree (the Office and OpenDocument types), and x-marks an unregistered de-facto type. A self-check function verifies that every record's top-level type equals its category, that every string matches the type/subtype grammar, and that no extension is claimed twice — the lookup's version of a cross-formula check.

Worked examples

Forward lookup — an Office spreadsheet

  1. Input: xlsx (or .xlsx, or *.xlsx)
  2. Normalise → strip the dot/glob, lowercase → xlsx
  3. No slash → forward lookup on the extension index
  4. Match: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  5. IANA vendor (vnd.) tree · header → Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Reverse lookup with parameters — an HTML page

  1. Input: text/html; charset=utf-8
  2. Contains '/' and matches the RFC 6838 grammar → reverse lookup
  3. Drop the parameter after ';' → text/html
  4. Exact match: extension .htm / .html, category Text, IANA-registered
  5. Charset is conventional for text/* → header keeps; charset=utf-8

Fallback — an unknown extension

  1. Input: zzz (no entry claims this extension)
  2. Forward lookup misses → return the safe default
  3. Result: application/octet-stream (isFallback = true)
  4. Why: it is the generic binary type browsers use for unknown content
  5. Closest matches are offered as one-tap suggestions underneath

Frequently asked questions

Sources & references

Type strings follow the IANA registry verbatim; the IANA/de-facto labels follow RFC 6838's registration trees. The bundled table was last cross-checked against the IANA registry and Apache mime.types on 2026-06-27.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a wrong type, a missing extension, or an edge case?

Email me at [email protected] — most fixes ship within 24 hours.