MIME Type Lookup

Find the right Content-Type for a file extension, or the extensions for a MIME type, with ready-to-paste Apache and nginx lines. You can also check what a file really is from its first bytes.

Updated
Looked up in your browser. Files are read locally, never uploaded.

How to use the MIME Type Lookup

  1. Type an extension such as .webp or a type such as image/webp into Extension or MIME type.
  2. Select a row to see the Apache and nginx config lines for it.
  3. To check an actual file, open Check a file and choose or drop it. Only its first bytes are read.

How it works

  • The list comes from mime-db, which combines the IANA registry with the Apache and nginx type files. Only types that have file extensions are included, about 1,000 in all.
  • When several types share an extension, the IANA-registered one is listed first.
  • The file check reads the first 64 bytes and compares them with known signatures, or "magic numbers": PNG starts with 89 50 4E 47, PDF with %PDF-, ZIP with PK, and WebP with RIFF...WEBP.
  • The result is compared with the type the extension suggests, and with the type your browser reports.

Examples

  • .webp → image/webp; Apache line AddType image/webp .webp.
  • .js → text/javascript, the type the HTML standard now uses; application/javascript is the older name.
  • .json → application/json, compressible.
  • A file named photo.jpg that starts with 89 50 4E 47 is really a PNG, and the tool warns that the extension is wrong.

Common web MIME types

ExtensionMIME type
.htmltext/html
.csstext/css
.js, .mjstext/javascript
.jsonapplication/json
.svgimage/svg+xml
.webpimage/webp
.avifimage/avif
.woff2font/woff2
.webmanifestapplication/manifest+json
.wasmapplication/wasm

Limitations

  • Plain text formats (CSV, TXT, JS, CSS) have no signature, so a file check can only use the extension for them.
  • Office files (DOCX, XLSX) and many others are ZIP archives inside, so they are detected as ZIP; that is expected.
  • The list is updated when the site is released, so very new types may be missing.

Frequently asked questions

What is a MIME type?

A label such as image/png that tells browsers and servers what kind of data a file holds. Servers send it in the Content-Type header.

Why does the wrong MIME type matter?

Browsers refuse to run scripts and styles with the wrong type when X-Content-Type-Options: nosniff is set, and downloads may open in the wrong app.

How do I set a MIME type on my server?

On Apache, add an AddType line to .htaccess. On nginx, add the type to a types block. Select a row in the results to copy both.

Are my files uploaded?

No. Only the first 64 bytes are read, in your browser.

Often used together with the MIME Type Lookup.