📄 MIME Type Lookup
By ToolNimba Web Dev Team · Updated 2026-06-19
Click any extension or MIME type to copy it.
| Extension | MIME type | Description |
|---|
Showing all MIME types.
This MIME type reference maps common file extensions to their correct MIME (content) types and lets you search either way. Type an extension like png or json, or a type like video or application/pdf, and the matching rows appear instantly. Click any extension or MIME type to copy it, so you can drop the right value straight into a Content-Type header, a server config, or an upload filter.
What is the MIME Type Reference?
A MIME type (Multipurpose Internet Mail Extensions type), also called a media type or content type, is a short two-part label that tells software what kind of data a file contains. It has the form type/subtype, for example text/html, image/png, or application/json. The first part is the general category (text, image, audio, video, application, or font) and the second part names the specific format. Browsers, web servers, email clients and APIs all rely on this label rather than on the file extension to decide how to handle a file.
MIME types matter most in the HTTP Content-Type header. When a server sends a response, the Content-Type tells the browser whether to render the bytes as a web page, display them as an image, play them as audio, or offer them as a download. If the type is wrong or missing, the browser may guess (a process called MIME sniffing), which can break a page or, worse, open a security hole. Setting the correct type, and sending the X-Content-Type-Options: nosniff header, keeps behaviour predictable.
File extensions and MIME types are related but not the same thing. The extension is just a naming convention on the filename, while the MIME type is metadata sent alongside the actual bytes. A file named photo.png that is really a PDF will not display correctly if the server insists on image/png. The official registry of media types is maintained by IANA, and web servers map extensions to types through their own configuration (for example the mime.types file used by Apache and Nginx).
When to use it
- Setting the correct Content-Type header when serving files from a backend or API.
- Configuring a web server (Apache, Nginx) or CDN to send the right type for a new file extension.
- Validating the allowed MIME types for a file upload form so users cannot submit the wrong format.
- Looking up which extension matches a content type you see in browser dev tools or an HTTP response.
- Choosing the accept attribute values for an HTML file input to filter the file picker.
How to use the MIME Type Reference
- Type a file extension (such as png, .json, or svg) or a MIME type (such as video, image, or application/pdf) into the search box.
- Optionally click a category filter (Text, Image, Audio, Video, Application, Font) to narrow the list.
- Find the matching row showing the extension, the MIME type, and a short description.
- Click the extension or the MIME type to copy that exact value to your clipboard.
- Paste the copied value into your Content-Type header, server config, or upload filter.
Formula & method
Worked examples
You are serving a JSON API response and need the correct header value.
- Search for json in the box.
- The row shows .json mapped to application/json.
- Click application/json to copy it.
- Set the header: Content-Type: application/json
Result: Content-Type: application/json (add ; charset=utf-8 if you send non-ASCII text).
You want a file upload form to accept only PNG and JPEG images.
- Search for png to confirm .png maps to image/png.
- Search for jpg to confirm .jpg and .jpeg map to image/jpeg.
- Use those types in the input accept attribute.
- Set accept="image/png, image/jpeg" on the file input.
Result: The file picker is limited to image/png and image/jpeg files.
The six top-level MIME type categories
| Top-level type | Used for | Example |
|---|---|---|
| text | Human-readable text formats | text/html, text/css |
| image | Still and animated images | image/png, image/svg+xml |
| audio | Sound and music files | audio/mpeg, audio/wav |
| video | Moving picture files | video/mp4, video/webm |
| application | Binary or structured app data | application/json, application/pdf |
| font | Web and desktop font files | font/woff2, font/ttf |
Frequently needed extension to MIME type mappings
| Extension | MIME type |
|---|---|
| .html | text/html |
| .css | text/css |
| .js | text/javascript |
| .json | application/json |
| .png | image/png |
| .jpg / .jpeg | image/jpeg |
| .svg | image/svg+xml |
| application/pdf | |
| .mp4 | video/mp4 |
| .zip | application/zip |
Common mistakes to avoid
- Serving JavaScript or CSS as text/plain. Browsers refuse to run a script or apply a stylesheet sent with the wrong type. JavaScript should be served as text/javascript (the type the HTML spec now recommends) and CSS as text/css, otherwise the file is ignored.
- Using application/octet-stream for everything. The generic application/octet-stream type tells the browser the data is unknown binary, which usually triggers a download instead of inline display. Use the specific type so images render and PDFs open in the viewer.
- Forgetting the charset on text responses. A text type without a charset can be decoded with the wrong encoding and show garbled characters. Add ; charset=utf-8 to text and JSON responses that contain non-ASCII content.
- Trusting the file extension instead of the type. Renaming a file does not change its actual contents. For uploads, validate the real MIME type (and ideally inspect the bytes), since a malicious file can carry any extension you like.
Glossary
- MIME type
- A two-part label (type/subtype) that identifies the format of a file or data stream, also called a media type or content type.
- Content-Type header
- The HTTP header that carries the MIME type of the response body so the client knows how to handle it.
- Subtype
- The second half of a MIME type that names the specific format, such as png in image/png.
- MIME sniffing
- When a browser inspects the actual bytes to guess a type because the declared type is missing or looks wrong.
- charset parameter
- An optional parameter after a semicolon (for example ; charset=utf-8) that states the text encoding of the content.
- IANA
- The Internet Assigned Numbers Authority, which maintains the official registry of media (MIME) types.
Frequently asked questions
What is a MIME type?
A MIME type is a short label in the form type/subtype, such as text/html or image/png, that tells software what kind of data a file holds. Browsers, servers and APIs use it (mainly via the HTTP Content-Type header) to decide how to handle the file, rather than relying on the file extension.
How do I find the MIME type for a file extension?
Type the extension (for example png, .json, or svg) into the search box above. The matching row shows the correct MIME type and a short description. Click the MIME type to copy it. You can also search the other way, by typing a type like video to see every extension in that category.
What is the MIME type for a JavaScript file?
The recommended MIME type for JavaScript is text/javascript, which the HTML specification now defines as the standard. You may still see older types such as application/javascript or application/x-javascript in legacy configs; modern servers should use text/javascript.
What is application/octet-stream used for?
application/octet-stream is the generic type for arbitrary binary data when the exact format is unknown. Servers fall back to it for unrecognised files, and it usually makes the browser download rather than display the file. Use a specific type whenever you know it so content renders correctly.
Is a MIME type the same as a file extension?
No. The extension is part of the filename and is just a naming convention, while the MIME type is metadata sent alongside the actual bytes (most often in the Content-Type header). They usually correspond, but the type is what software trusts, so they can disagree if a file is mislabelled.
How do I set the correct Content-Type header?
Look up the file in the table, copy its MIME type, and set it as the Content-Type value in your server response. For text and JSON add ; charset=utf-8 when the content is not plain ASCII. Web servers like Apache and Nginx map extensions to types automatically through their mime.types configuration.