MIME Type Lookup
Find the MIME type for a file extension or file name, or the extensions for a MIME type, with IANA status, aliases and the nginx, Apache or IIS config line.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the MIME Type Lookup?
Type a file extension, a whole file name or a MIME type and this lookup returns the matching media type, the extensions it covers and whether it is registered with IANA. Searching "webp" gives image/webp, searching "report.docx" gives the long Office Open XML type, and searching "application/json" or even "image/*" goes the other way and lists the extensions. Each result shows the exact Content-Type header to send, with charset=utf-8 added for text formats, and the line to add to nginx, Apache or an IIS web.config so your server sends it.
The table covers about 120 types that web developers actually serve: web assets, fonts, images, audio and video, office documents, archives, packages and data formats such as YAML, Parquet and GeoJSON. Notes flag the traps, such as .ts being MPEG transport stream video on most servers rather than TypeScript, image/jpg not existing, and text/javascript replacing application/javascript. A second panel lets you pick any file on your computer and compare the type your browser guesses with the table, without uploading the file.
- About 120 types with extensions, aliases and IANA status
- Lookup by extension, file name, URL or MIME type, including image/* wildcards
- Content-Type header with charset where it matters
- nginx, Apache and IIS configuration snippets
- Local file check against the browser's own guess
- Notes on deprecated, ambiguous and unregistered types
How to use the MIME Type Lookup
- Type an extension (with or without the dot), a file name or path, or a MIME type into the search box.
- Optionally narrow the list to one category such as fonts, images or documents.
- Click a result to see its details, aliases, notes and the Content-Type header.
- Choose nginx, Apache or IIS to get the configuration line for that server, then copy it.
- To check a file, choose it in the "Check a file" panel and compare the browser's guess with the table.
Worked examples
Modern image format
Input
avif
Output
image/avif
Add it to older servers whose mime.types predates AVIF, or browsers will receive application/octet-stream and refuse to show it inline.
Office download
Input
budget.xlsx
Output
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
The long vnd type is correct. Sending application/vnd.ms-excel makes some browsers offer the wrong application.
Reverse lookup
Input
application/javascript
Output
.js and .mjs, with text/javascript as the current type
Aliases are matched, so old types still find the right entry and show you the current one.
Font served by nginx
Input
woff2, server nginx
Output
types { font/woff2 woff2; }Recent nginx releases include this mapping; older ones need the line inside the http or server block.
Background and insight
MIME types began in email: RFC 2045 and RFC 2046 (1996) defined the type/subtype format and top-level types such as text, image, audio, video and application, so a mail client could tell an attachment from the message body. HTTP borrowed the scheme for its Content-Type header, and IANA keeps the Media Types registry. Registered vendor types use the vnd. prefix (application/vnd.ms-excel), structured syntax suffixes such as +json and +xml say how to parse a type you do not know (application/ld+json is JSON), and the old x- prefix for unregistered types is discouraged by RFC 6648 but still widespread.
Some types changed recently. RFC 9239 (2022) made text/javascript the only recommended type for JavaScript and marked application/javascript obsolete. RFC 9512 (2024) registered application/yaml. WebP finally got its RFC, 9649, in 2024. RFC 8081 created the font top-level type, so WOFF2 is font/woff2. JSON is always UTF-8 under RFC 8259, so application/json takes no charset parameter.
Browsers do not always trust the header. The WHATWG MIME Sniffing standard lets them inspect the first bytes of a response when the type is missing or generic, which is how an HTML file served as text/plain could once run scripts. Sending X-Content-Type-Options: nosniff turns that off for scripts and stylesheets, and in return the browser refuses a script whose type is not a JavaScript MIME type. A correct type table on the server is therefore a security setting as well as a convenience.
Common use cases
Configuring a web server or CDN
Add missing types for AVIF, WebAssembly, web manifests or fonts so files load instead of downloading.
Writing upload and download code
Set the right Content-Type in S3 metadata, an API response or a multipart upload.
Validating uploads
Compare the extension a user sent with the type you expect, keeping in mind that both can be faked.
Debugging blocked scripts
Find why a browser refuses a script or stylesheet under nosniff, or why an SVG will not render in an img tag.
Tips and limitations
- Serve unknown binary files as application/octet-stream; browsers then download rather than guess.
- Add X-Content-Type-Options: nosniff and make sure every script and stylesheet has the correct type.
- Never trust a client-supplied Content-Type or extension for security decisions; check the file's magic bytes on the server.
- Text formats need a charset. Send text/html; charset=utf-8 rather than relying on the browser to guess.
- An extension can belong to different formats in different contexts (.ts, .m4v, .pem); the notes call these out.
Frequently asked questions
What is the correct MIME type for JavaScript?
text/javascript. RFC 9239 (2022) made it the single recommended type and marked application/javascript and application/x-javascript obsolete. Browsers accept all of them, but text/javascript is what servers should send for .js and .mjs files.
Is image/jpg a valid MIME type?
No. The registered type for JPEG is image/jpeg for .jpg, .jpeg and related extensions. Many browsers tolerate image/jpg, but validators and some APIs reject it.
What MIME type should a .ts file have?
On web servers .ts maps to video/mp2t, the MPEG transport stream used by HLS video. TypeScript source has no registered type; if you must serve it, tools use text/x-typescript or application/typescript.
Why does my SVG not show in an img tag?
The server is probably sending it as text/plain, text/xml or application/octet-stream. Browsers only render SVG images served as image/svg+xml. Add the mapping for .svg to your server.
Should JSON responses include charset=utf-8?
It is not needed. RFC 8259 requires JSON exchanged between systems to be UTF-8, and the application/json registration defines no charset parameter. Adding one is harmless but ignored.
What is the difference between a MIME type and a file extension?
An extension is part of a file name and is a hint on disk. A MIME type travels in the Content-Type header and tells the receiver how to interpret the bytes. Servers map one to the other using a table like this one.
Is there an in-depth guide to the MIME Type Lookup?
Yes. “MIME Types and Content-Type: Getting Files Served Correctly” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
People also search for
- what is the mime type for webp
- correct content type for javascript files
- application json vs text json
- mime type for docx and xlsx files
- svg not displaying wrong content type
- is image jpg a valid mime type
- add mime type for woff2 in nginx
- what mime type is .ts file
Related Tools You May Like
Free, in-browser tools that pair well with this one.