MIME Type Lookup
Find the media type (MIME type) for a file extension, or the extensions for a media type, from the IANA registry joined with the Apache, nginx and mime-db lists. Each result shows the right Content-Type header, whether the type is registered, where the sources disagree, and what a browser does with it. Drop a file to compare its real bytes with what its name claims.
How to Use
- Type an extension (
.webp), a file name (report.docx), a media type (application/json) or a word such as word or font. Matches appear as you type; press Enter or pick one. - Read the result: the Content-Type header to send (with Copy), whether IANA registered the type, its RFC or owner, its extensions, and whether it is text or binary.
- Check the picture: it splits the type into top-level type, tree, subtype, structured suffix and parameter, the way RFC 6838 defines them.
- To check a real file, drop it on Check a file. Its first bytes are compared with the type its extension implies, and a mismatch (a PNG named
.jpg) is flagged. Nothing is uploaded. - Open Show Work to see which of the four sources list the answer, where they disagree, and why one type was chosen. Copy the Apache, nginx or IIS line if your server sends the wrong type.
Worked Example
.js — the sources disagree. Apache httpd’s mime.types maps js and mjs to text/javascript. nginx’s mime.types still maps js to application/javascript, and mime-db lists js under both. The IANA registry settles it: application/javascript is marked “OBSOLETED in favor of text/javascript” by RFC 9239. So the answer is Content-Type: text/javascript; charset=utf-8. Nothing breaks on an nginx site, because application/javascript is still one of the sixteen JavaScript MIME types browsers accept.
.mjs on a stock nginx server — the common mistake. nginx’s mime.types has no mjs entry at all. With no match, nginx sends default_type, which the stock nginx.conf sets to application/octet-stream (nginx’s built-in default is text/plain). Either way it is not a JavaScript MIME type, and the HTML standard tells the browser to refuse a module script with any other type, so import fails with a “strict MIME type checking” error. The fix is one line in mime.types: text/javascript js mjs;. Apache’s current mime.types already lists mjs on its text/javascript line, so the same file works there.
holiday.jpg that is really a PNG. The name says image/jpeg. The first eight bytes are 89 50 4E 47 0D 0A 1A 0A, the PNG signature (a JPEG starts FF D8 FF), so the bytes say image/png and the check flags a mismatch. A browser still shows it in an <img>, because the MIME Sniffing standard lets it identify image formats from their bytes, but an upload filter that trusts the name, or the File.type the browser derives from it, has been fooled.
Show Work
Media Type Syntax (RFC 6838)
What Your Server Sends, and What Breaks
A web server picks the Content-Type from the file extension, using a table like the ones this tool reads. Browsers then check that label more or less strictly depending on what the file is for. Images are forgiving: the MIME Sniffing standard lets a browser recognise PNG, JPEG, GIF, WebP and the other raster formats from their bytes. Scripts, stylesheets and WebAssembly are not, and SVG is never sniffed, so a wrong label there breaks the page.
| File | Send | If the type is wrong |
|---|---|---|
| .js classic script | text/javascript | Runs with any of the 16 JavaScript MIME types. Blocked with X-Content-Type-Options: nosniff if it is anything else, and always blocked as image/*, audio/*, video/* or text/csv (Fetch standard). |
| .mjs / module | text/javascript | Refused unless it is a JavaScript MIME type, with or without nosniff (HTML standard). |
| .css | text/css | With nosniff, blocked unless the type is text/css. Even without it, the HTML standard does not apply the stylesheet, except to a same-origin page in quirks mode. |
| .wasm | application/wasm | instantiateStreaming() rejects with a TypeError. Parameters are not allowed, not even an empty ;. |
| .svg | image/svg+xml | A broken image in <img> and CSS backgrounds: there is no SVG pattern in the sniffing tables. |
| .json | application/json | fetch().json() does not care, but a text/html label can let a browser render user data in a JSON reply as a page, an XSS risk. |
X-Content-Type-Options: nosniff is the header that turns the label into a rule. Under the Fetch standard it does exactly two things: a script must carry a JavaScript MIME type and a stylesheet must carry text/css, or the response is blocked. It is good practice on every response, but only once the server’s types are right. When an extension is missing from the table, nginx falls back to default_type (application/octet-stream in the stock nginx.conf) and Apache httpd 2.4 sends no Content-Type, which leaves the browser to guess unless nosniff is set.
From Email Attachments to Every HTTP Response
Media types began as a way to send something other than plain ASCII text by email. Nathaniel Borenstein and Ned Freed published MIME, Multipurpose Internet Mail Extensions, as RFC 1341 in June 1992, and its current form as RFC 2045 and RFC 2046 in November 1996. MIME gave every message part a Content-Type made of a top-level type and a subtype, with application/octet-stream for arbitrary binary data and text/plain as the default. HTTP borrowed the header unchanged, which is why the web still speaks of “MIME types”; the standards now call them media types.
IANA, the Internet Assigned Numbers Authority, keeps the registry. Its rules today are RFC 6838 (January 2013, by Freed, Klensin and Hansen), which defines the naming syntax, the standards, vendor (vnd.), personal (prs.) and unregistered (x.) trees, and structured syntax suffixes such as +json and +xml, so a generic JSON or XML parser can handle a type it has never seen. In June 2012 RFC 6648 retired the “x-” prefix for new names, but thousands of x- types live on in server tables. On 9 October 2026 the registry held 2,366 types; the newest top-level type, haptics, was added by RFC 9695 in 2025.
Practice and the registry do not always agree, and JavaScript is the best-known case. RFC 4329 (2006) registered application/javascript and marked text/javascript obsolete; browsers and servers kept using text/javascript, and in May 2022 RFC 9239 reversed the decision and made text/javascript the only current JavaScript type. Browsers, meanwhile, follow the WHATWG MIME Sniffing standard, which defines how to parse a media type string, which sixteen names count as JavaScript, and when a browser may look at the bytes instead of the label. The Fetch standard adds X-Content-Type-Options: nosniff, which tells the browser not to second-guess the label for scripts and stylesheets.
About This Tool
This lookup joins four lists into one dataset of 2,727 media types and 1,241 extensions: the IANA Media Types registry (2,366 registered types, updated 9 October 2026), Apache httpd’s mime.types, nginx’s mime.types and jshttp’s mime-db 1.54.0, which Express and much of Node.js use. For every type it shows whether IANA registered it, its RFC or owner, its tree, its extensions, whether it is text and whether mime-db marks it compressible, and the Content-Type header to send. When the lists map an extension to more than one type, it prefers a current IANA registration, then the type most lists agree on, and Show Work explains the choice. The file check reads a file’s first bytes with the same detector as the File Inspector and compares them with what the name implies.
Everything runs in your browser. The dataset is a single file of about 42 KB compressed, loaded with the page, and a file you check is read on your device, never uploaded. It is for web developers fixing server types, back-end developers validating uploads, and anyone puzzled by a type in an email header or an API response.
Related tools: .htaccess Generator, HTTP Status Codes, and File Inspector.
Frequently Asked Questions
What is a MIME type?
A MIME type, now officially called a media type, is a label such as image/png or application/json that says what kind of data a file or message holds. It has a top-level type, a slash and a subtype, optionally followed by parameters such as ; charset=utf-8. It was invented for email attachments (MIME, RFC 1341 in 1992 and RFC 2045–2046 in 1996), and the web uses the same labels in the HTTP Content-Type header. IANA keeps the official list; it held 2,366 registered types on 9 October 2026.
Is it text/javascript or application/javascript?
text/javascript. RFC 9239 (May 2022) made it the one JavaScript media type and marked application/javascript, application/ecmascript and text/ecmascript obsolete. That reversed RFC 4329 (2006), which had preferred the application/ form, because browsers and servers kept using text/javascript anyway. Browsers still accept all sixteen JavaScript MIME types listed in the WHATWG MIME Sniffing standard, so an old server sending application/javascript does not break anything; nginx’s stock mime.types still does.
Why does the browser refuse my .mjs or .wasm file with a MIME type error?
Module scripts and WebAssembly streaming check the type strictly. The HTML standard rejects a module script whose Content-Type is not a JavaScript MIME type, and WebAssembly.instantiateStreaming() rejects anything but exactly application/wasm, without parameters. nginx’s stock mime.types has no .mjs entry, so it sends its default_type, which the stock nginx.conf sets to application/octet-stream. Add mjs to the text/javascript line, or in Apache use AddType text/javascript .mjs.
What does application/octet-stream mean?
It means “arbitrary binary data” (RFC 2046, section 4.5.1): the sender either does not know the type or does not want the receiver to interpret it. Browsers download it rather than display it, which is why it is used to force a download and why it is the fallback for unknown extensions. Servers differ on the fallback, though: nginx’s stock config sends it, while Apache httpd 2.4 sends no Content-Type at all for an extension it does not know (DefaultType has been disabled since 2.3) and leaves the browser to sniff.
Can I trust a file’s extension or the type the browser reports? Is my file uploaded?
No: the extension, and the File.type a browser reports on upload, both come from the file name, so a renamed file lies. The bytes at the start of most binary formats are fixed (PNG begins 89 50 4E 47 0D 0A 1A 0A, PDF %PDF-, ZIP and Office files PK 03 04), and the file check here reads them. Plain-text formats such as CSV, JavaScript and Markdown have no signature, so for those it can only say “text”. The file never leaves your browser: only the first 16 KB is read, on your device.
How do I use the MIME Type Lookup?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Fixing “strict MIME type checking” errors
A module script served as application/octet-stream by stock nginx (no .mjs entry) is refused. Look up .mjs, copy the nginx line text/javascript js mjs;, reload, and the import works.
WebAssembly that will not stream
instantiateStreaming() throws a TypeError unless the header is exactly application/wasm. Even application/wasm; charset=utf-8 fails, so the tool shows the header without a charset.
Upload validation
A photo named holiday.jpg whose first bytes are 89 50 4E 47 is a PNG. The file check flags the mismatch, the same test an upload handler should run instead of trusting the name or File.type.
API and download headers
Send application/json (RFC 8259 defines no charset parameter), application/problem+json for RFC 9457 error bodies, and the 71-character OOXML type for a .docx download instead of a guess.
Reading an unfamiliar type
Paste application/vnd.api+json; charset=utf-8 to see it split into top-level type, vendor tree, subtype, the +json suffix and the parameter, and whether IANA has a registration for it.
Last updated: