What this tool does
It answers the question “what should the Content-Type be?” in both directions. Enter a file name, a URL or an extension to get the type. Enter a type to get its usual extensions. Paste a whole Content-Type header to check its syntax. Each answer comes with snippets you can copy: the HTTP header, an HTML accept attribute, an nginx types line and an Apache AddType line, plus notes on pitfalls for that type.
The table below the results lists every entry and can be narrowed by group (text, images, fonts and so on) and by name form (see the next section).
What a MIME type and a Content-Type are
A MIME type, also called a media type, names the kind of data in a message. It has the form type/subtype, for example text/html or image/png. In HTTP it travels in the Content-Type header, and in an upload form it appears in the accept attribute. The name MIME comes from email, where it was first used.
- Type is the broad family:
text,image,audio,video,font,application(anything that does not fit the others) andmultipart. - Subtype is the specific format. A
+suffixsuch as+jsonor+xmlsays the content is built on that syntax, soapplication/problem+jsoncan be read by a generic JSON parser. - Parameters follow a semicolon, for example
text/html; charset=utf-8. The common ones arecharsetand, for multipart bodies,boundary. - Name form. A subtype with the prefix
vnd.belongs to a vendor,x-marks an unregistered name,prs.is the personal tree, and everything else has no prefix. The filter in the tool uses this form. It describes how the name is written, not whether a type is registered with IANA, which this tool does not check.
Types are case-insensitive, but lowercase is the convention. The official list of registered types is the IANA media types registry.
MIME type versus file extension
The extension is part of a file name. The MIME type is metadata about the content, and over HTTP it is the type, not the extension, that tells the client what to do. A browser does not look at .json in a URL; it looks at the Content-Type the server sent.
- A web server decides the type by mapping the extension through a table (nginx
mime.types, Apachemime.typesandAddType). That is what this tool’s table is a reference for. - Dynamic responses have no extension. An API route such as
/api/usersmust set its ownContent-Type. - One extension can map to more than one name (for example
.yaml,.wavand.ico), and some types have several extensions (.jpgand.jpeg). - Do not trust either for security. A file name and the type sent by a browser during an upload are supplied by the client and can be anything. Check the content (for example the first bytes of the file) on the server, store uploads outside the web root or under a type you choose, and never serve user-uploaded HTML or SVG from your own origin without care.
Common web types
These are the headers most sites and APIs need. Anything with a text type should state its character set.
| Content | Content-Type to send |
|---|---|
| HTML page | text/html; charset=utf-8 |
| CSS | text/css; charset=utf-8 |
| JavaScript | text/javascript; charset=utf-8 |
| JSON API response | application/json |
| JSON error body (RFC 9457) | application/problem+json |
| Plain text | text/plain; charset=utf-8 |
| XML | application/xml |
| CSV | text/csv; charset=utf-8 |
| PNG / JPEG / WebP / AVIF | image/png, image/jpeg, image/webp, image/avif |
| SVG | image/svg+xml |
application/pdf | |
| WOFF2 font | font/woff2 |
| WebAssembly | application/wasm |
| Web app manifest | application/manifest+json |
| Form post | application/x-www-form-urlencoded |
| File upload | multipart/form-data; boundary=... |
| Server-Sent Events | text/event-stream |
| Unknown binary download | application/octet-stream |
Setting types on a server
Most servers ship with a table that covers common extensions. You only need to add a mapping for a format the table lacks, such as .wasm or .webmanifest on an older install.
http {
include mime.types;
default_type application/octet-stream;
}
# add one type without losing the defaults
server {
types {
include mime.types;
application/wasm wasm;
}
}AddType application/wasm .wasm AddType application/manifest+json .webmanifest AddDefaultCharset utf-8
The first block is nginx. A types block replaces the inherited table in its context, which is why it starts with include mime.types. The second block is Apache. Static hosts and CDNs usually have their own setting or a headers file, and a framework that serves an API sets the header in code. To see what a server actually sends, request a file and inspect the response with the HTTP Header Analyzer or curl -I (the cURL Command Generator builds the command).
Character sets
For text/* types the charset parameter tells the client how to turn bytes into characters. Use charset=utf-8 for HTML, CSS, JavaScript, CSV and plain text. Without it, a client may guess, and a wrong guess shows up as garbled accents or symbols. JSON is the exception: it is always UTF-8, so application/json; charset=utf-8 is redundant and a few strict clients complain about it. text/xml without a charset was historically read as US-ASCII, one reason application/xml is preferred.
nosniff and why a wrong type breaks a page
Browsers used to inspect content and guess its real type. That is a security risk, so the header X-Content-Type-Options: nosniff tells them to trust the declared type. With it, a script or stylesheet sent with the wrong type is blocked. In Chrome the console shows messages like these:
The usual cause is that the URL returned an HTML error page or a redirect to the app shell instead of the file, for example after a missing file or a wrong path. Check the real response first: look at its status code (see HTTP Status Codes) and its type. Module scripts and .wasm files are always checked, with or without nosniff. To set nosniff and other headers, use the Security Headers Generator.
Uploads and APIs
Content-Typedescribes the body you are sending or receiving.Acceptsays what you want back. A client sendsAccept: application/jsonto ask for JSON, and the server answers withContent-Type: application/json.- JSON requests need
Content-Type: application/json. Many servers ignore a JSON body sent astext/plainor as a form type. - File uploads use
multipart/form-data. The header must include theboundarythe body uses. Let the browser,fetchwith aFormDatabody, or your HTTP library set the header. If you set it yourself without the boundary, the server cannot split the parts. - The HTML
acceptattribute on<input type="file">takes extensions and types, such as.png,image/png, or a wildcard such asimage/*. It is a hint for the file picker and does not stop anyone from sending something else, so validate again on the server. - Errors. A server that cannot read the body type answers
415 Unsupported Media Type. One that cannot produce a type you asked for inAcceptmay answer406 Not Acceptable. Both are explained under HTTP Status Codes. - Data URIs carry a type too:
data:image/png;base64,.... The Image to Base64 tool builds one from an image, and the Base64 Encoder & Decoder handles other data.
Common mistakes
- Serving everything as
application/octet-streamortext/plain. Browsers then download the file or refuse to run it. - Using an obsolete JavaScript type such as
application/javascript. It still works, buttext/javascriptis the current standard (RFC 9239). - Writing
image/jpg. The type isimage/jpeg, although the extension is.jpg. - Sending JSON as
text/htmlortext/plain, which breaks clients that check the type and can create an XSS risk when a browser renders it. - Adding a charset to JSON, or leaving it off HTML and text.
- Serving
.wasmwithoutapplication/wasm, which disables streaming compilation. - Treating
.tsas TypeScript. In most MIME tables.tsisvideo/mp2t, an MPEG transport stream. Servers rarely need to send TypeScript, and build tools usually emit.js. - Putting a wildcard such as
image/*in aContent-Type. Wildcards are only forAcceptand the HTMLacceptattribute. - Relying on the extension or the client’s reported type to validate an upload.
Data source and limits
The list is curated by DevToolEra. It is not a copy of another table and not a live view of the IANA registry. It contains about 100 entries: common web, API, image, audio, video, font, document and archive formats, plus several types with no file extension (form posts, multipart bodies, event streams and JSON patch formats).
- How it was checked. Entries were compared with the
mime.typesfile shipped with a Debian system and with the table in Python’smimetypesmodule. Differences are shown as “Also seen” names or in the note on the entry. The notes draw on the RFCs for the formats concerned, for example RFC 8259 for JSON, RFC 9239 for JavaScript, RFC 9512 for YAML and RFC 9457 for problem details. - Not exhaustive. There are many more registered types than this list. A missing entry does not mean a type is invalid. Look it up in the IANA registry linked above.
- Not a registration checker. The “name form” filter only reads the subtype prefix. It does not tell you whether IANA has registered a name.
- Not a file inspector. The tool never opens a file. A name or extension you type is matched against the table, nothing more. To find out what a file really contains, inspect its bytes.
- Conventions change. Names such as
application/yamlare recent. Software that predates them may expect an older name, so check what your receiver accepts.
Frequently asked questions
What is the MIME type of a file extension?
Enter the extension (such as .json) or the file name. The result shows the type, a ready-to-copy header and server snippets, and any notes. For example, .json gives application/json and .svg gives image/svg+xml.
What is the difference between MIME type and Content-Type?
The MIME type is the type/subtype name. Content-Type is the HTTP header that carries it, optionally with parameters such as charset.
What is application/octet-stream?
It means arbitrary binary data. Browsers do not display it but offer a download. It is the right default for unknown content and the wrong choice for a format you know.
Does the file extension control the MIME type?
Not directly. On a web server a table maps extensions to types, but the client uses only the type the server sends. Content generated by code can have any type, whatever the URL ends in.
Can I check the type of an actual file?
Not here. This tool matches names and extensions only and does not read your files.
Why does one extension have several types?
Formats gain official names over time while older software keeps the earlier ones, for example image/x-icon and image/vnd.microsoft.icon for .ico. This tool shows the preferred name first and the others as “Also seen”.
Privacy and local processing
This tool runs entirely in your browser. The names, extensions and headers you type are matched against the list on this page and are not sent to a server. Nothing is stored.