Showing 80 / 1239 · use search or filters to narrow down
mime-db (IANA / Apache / nginx) · 1,239extensions · 2026-10-27
About MIME Type Lookup
Handling file uploads, configuring static asset serving or diagnosing why a browser downloads a file instead of opening it all comes back to content type. It is the declaration a server uses to tell the client what a byte stream is, and when the declaration disagrees with the content the browser behaves unexpectedly. A type consists of a top-level type and a subtype separated by a slash, with text, image, application and multipart as the common top-level families. Beyond the type itself, several parameters change behaviour: the charset parameter decides how text is decoded, and the boundary parameter exists only for multipart types, separating the parts. Without a charset the browser sniffs the encoding, which may succeed or fail, so text responses should always declare one. Practical notes: Static asset servers should map each extension explicitly rather than rely on built-in defaults, since those defaults vary between versions and some extensions have no registered type at all. Disabling content sniffing for script-like resources is also advisable, so a wrong declaration cannot lead to execution. The reverse direction matters too: when the type of an uploaded file is unknown, declare a generic binary type with a download disposition header, preventing inline rendering from creating an injection risk. Limits: Extensions and types are not one-to-one, since the same extension has different conventions per platform and one type may map to several extensions, so reversing from an extension is not a trustworthy determination. The content itself is the evidence, which means real type detection must read the leading bytes, and that is exactly why security validation cannot trust only the extension and the declared type. Some types also behave differently across browsers and versions, particularly vector graphics and certain media types, so uploaded content should be re-processed on the server rather than passed through. Data and privacy: looking up and configuring content types involves no sensitive data, and this tool performs the lookup in the browser without uploading input. If what you need to check is an internal API's response type, avoid pasting the authenticated response body into an online service. A few things worth pinning down operationally: keep the content type mapping in a versioned configuration file rather than relying on server defaults that drift across upgrades. Declare a charset explicitly on every text response to remove the uncertainty of client-side sniffing. And apply a download disposition header plus sniffing protection to uploads, closing off the risk that a file gets rendered as executable content. Each setting looks minor, yet they come up repeatedly in security audits and incident reviews, and standardizing early beats patching reactively. To begin, list the extensions your site actually serves, verify each mapping, then check that text resources all carry a charset and script-like resources all disable sniffing. Those three steps cover the overwhelming majority of legacy problems. For maintenance, treat the mapping as code: changes go through review, validation runs before deploy, and adding a rule to the development process that a new file type updates the mapping, so nobody adds a new asset one day and finds it served as a download in production.
How It Works Internally
A content type is a top-level type plus a subtype, optionally with parameters: the charset parameter decides how text is decoded and the boundary parameter appears only for multipart types, separating the parts. It is a declaration, and consistency with the actual bytes is the server responsibility; real type detection must read the leading bytes, since neither the extension nor the declaration can be trusted. Without a charset the browser sniffs the encoding.
A UTF-8 HTML responsetext/html; charset=utf-8 (without charset the browser sniffs and may guess wrong)Measured on This Page
| Extensions covered | 1,239, mapping to 1,015 registered MIME types |
|---|---|
| Data source | mime-db aggregate: 2,136 IANA entries + 275 Apache + 13 nginx |
| Ambiguous extensions | 48 extensions differ between sources (e.g. .exe is both application/octet-stream and application/x-msdownload); the IANA value wins |
| Google, last 90 days | 3 clicks / 40 impressions / average position 23.8 |
The registered MIME type for .js is text/javascript (RFC 9239, published 2022), not the application/javascript still found in many server configs — the latter was removed from the spec. Likewise IANA moved .yaml from application/yaml to text/yaml. These two cause the most confusion when updating Nginx or bundler config.
How to Use
- Open "MIME Type Lookup"
- Filter by file extension or MIME keyword
- Switch the category tabs for image, text or archive types
- Check the mapping between extension and MIME type
- Click the copy icon to paste the value into your config
Use Cases
- Static server config — Complete mime.types maps for Nginx or Apache so files are not served as text/plain.
- Download headers — Find the right Content-Type when serving files so browsers preview or download correctly.
- Upload validation — Check that the frontend accept attribute matches the backend allowed MIME list.
- Render debugging — When JS or CSS fails, confirm the server returns a spec-compliant type.
- API negotiation — Pick the correct type string for Accept, like application/vnd.api+json.
- S3 bucket config — Look up the correct Content-Type per file extension when setting up an S3 static site or CDN.
- HTTP header debugging — Check whether a server's Content-Type header matches the expected MIME for a given resource.
FAQ
What if Content-Type is wrong?
Browsers may refuse to run scripts (ES Modules require text/javascript) or render a page as plain text. With X-Content-Type-Options: nosniff, they strictly honor the declared type.
Is each extension tied to one MIME?
Not always. For example .js historically used text/javascript and application/javascript; the spec now recommends text/javascript. Similarly .xml has both text/xml and application/xml.
When do I add charset?
For text/* and some text-based types, append ;charset=utf-8 to declare encoding and avoid garbled characters; binary types like image/png do not need it.
How to detect type for files without extensions?
You can read the file header magic number, but this tool queries by extension and type table. Runtime detection needs content sniffing via a server or library.
What is application/octet-stream?
It is the generic "unknown binary stream" type, which browsers typically download directly. Use it to force a download of an arbitrary file instead of previewing.
The type is configured correctly yet the browser still downloads the file. Why?
Beyond the content type, two factors force a download: a response carrying a download disposition header, and a type set to the generic binary value. Some types are also designed by browsers to download rather than render inline, so a correct declaration still will not display. Check the disposition header, the type, and whether that type can render inline, in that order.
Is it safe to return an uploaded file to the browser as-is?
No. If the upload is script-like content and the response renders it inline, you have let a visitor execute code supplied by the uploader. Set a download disposition header and a generic binary type for uploads, and when a preview is needed, convert server-side or host the file on an isolated domain rather than returning the original inline.
Why does one file extension have multiple MIME types?
History and implementations: .js maps to both text/javascript and application/javascript, with the former being the current standard. Follow IANA registration or de facto practice; prefer modern values like text/javascript and consult legacy docs only if rejected.