MIME Type Lookup
Look up MIME types by file extension
Text
text/plaintext/htmltext/csstext/javascripttext/csvtext/xmltext/markdowntext/calendarApplication
application/jsonapplication/xmlapplication/pdfapplication/zipapplication/gzipapplication/x-tarapplication/x-7z-compressedapplication/x-rar-compressedapplication/javascriptapplication/typescriptapplication/wasmapplication/octet-streamapplication/x-www-form-urlencodedapplication/ld+jsonOffice
application/mswordapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.ms-excelapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.ms-powerpointapplication/vnd.openxmlformats-officedocument.presentationml.presentationImage
image/jpegimage/pngimage/gifimage/webpimage/svg+xmlimage/bmpimage/tiffimage/x-iconimage/avifimage/heicAudio
audio/mpegaudio/wavaudio/oggaudio/webmaudio/aacaudio/flacaudio/midiVideo
video/mp4video/webmvideo/oggvideo/quicktimevideo/x-msvideovideo/x-matroskavideo/x-flvFont
font/wofffont/woff2font/ttffont/otfapplication/vnd.ms-fontobjectMultipart
multipart/form-datamultipart/byterangesAbout MIME Types
MIME (Multipurpose Internet Mail Extensions) types indicate the nature and format of a file. They're used in HTTP headers, email attachments, and more. The format is type/subtype.
The MIME Type Lookup provides bidirectional search between file extensions and MIME types (also called media types or content types), helping you find the correct Content-Type header for any file format or identify which extensions map to a given MIME type. Enter .woff2 to learn that the correct type is font/woff2, or search application/json to see all associated extensions like .json, .map, and .geojson.
Understanding MIME Types
MIME types -- originally "Multipurpose Internet Mail Extensions" but now used far beyond email -- are the standard way to identify file formats on the web. When a web server sends a file to your browser, it includes a Content-Type header containing the MIME type, and the browser uses that type to decide how to handle the response. An HTML file gets rendered as a page, a PNG gets displayed as an image, a PDF opens in the viewer, and a ZIP gets offered as a download. Without the correct MIME type, the browser has to guess, and guessing often goes wrong.
The reason MIME types matter more than file extensions is that HTTP responses do not carry filenames. When your browser requests https://example.com/api/data, there is no .json extension to hint at the format -- the browser relies entirely on the Content-Type: application/json header to know it is receiving JSON. If the server sends text/plain instead, the browser will display the raw text rather than parsing it as structured data. And with the X-Content-Type-Options: nosniff security header (which all modern applications should set), the browser strictly enforces the declared MIME type and will not try to guess from the content.
For web developers, the most common MIME type issues arise from server misconfiguration. A new font format like .woff2 gets served as application/octet-stream because the server does not have a mapping for that extension, causing the browser to download it instead of using it as a font. A JavaScript file gets served as text/plain and is blocked by the browser's MIME checking. An SVG file is served without the +xml suffix and fails to render. This lookup tool helps you find the correct type quickly so you can update your server configuration with confidence.
How to Look Up a MIME Type
- Enter a file extension (e.g.,
.json,.webp,.woff2) or a MIME type (e.g.,application/pdf,image/svg+xml). - View the matching result with the primary MIME type, alternative types, and browser support notes.
- Copy the correct
Content-Typevalue for use in server configuration or HTTP headers.
MIME Type Lookup Examples
Search by File Extension
| Extension | Primary MIME Type | Alternatives / Notes |
|---|---|---|
.html | text/html | -- |
.css | text/css | -- |
.js | application/javascript | Legacy: text/javascript (still widely used) |
.json | application/json | -- |
.xml | application/xml | Also: text/xml |
.svg | image/svg+xml | -- |
.png | image/png | -- |
.jpg / .jpeg | image/jpeg | -- |
.webp | image/webp | -- |
.avif | image/avif | Modern format, check browser support |
.gif | image/gif | -- |
.pdf | application/pdf | -- |
.woff2 | font/woff2 | -- |
.woff | font/woff | Legacy: application/font-woff |
.mp4 | video/mp4 | -- |
.webm | video/webm | -- |
.zip | application/zip | -- |
.gz | application/gzip | -- |
.csv | text/csv | -- |
.md | text/markdown | Not universally recognized by servers |
Search by MIME Type
| MIME Type | Associated Extensions |
|---|---|
application/octet-stream | .bin, .exe, .dll, .iso, and any unknown binary |
text/plain | .txt, .log, .ini, .cfg |
application/json | .json, .map, .topojson, .geojson |
image/jpeg | .jpg, .jpeg, .jfif |
application/xml | .xml, .xsl, .xsd, .rng |
When to Use MIME Type Lookup
- Configuring web server content types -- Set the correct
Content-Typefor static files served by nginx, Apache, or IIS to prevent download-instead-of-display issues. - Setting download headers -- Use the right MIME type in
Content-TypeandContent-Dispositionheaders for file downloads. - Validating file uploads -- Check uploaded files against expected MIME types to reject unsupported formats.
- Debugging "file not recognized" errors -- Identify when a server sends the wrong MIME type, causing browsers to mishandle the file.
- Configuring CDN caching -- Set correct MIME types so CDNs apply appropriate caching and compression rules.
- Email attachment handling -- Use the correct type when building MIME multipart messages for email attachments.
How MIME Types Work
MIME Type Structure
A MIME type follows the format type/subtype, optionally with parameters:
type/subtype; parameter=value
The type is the general category (text, image, audio, video, application, font, multipart). The subtype is the specific format. For example, image/png is an image in PNG format.
Common Parameters
charset-- Character encoding for text types:text/html; charset=utf-8boundary-- Separator for multipart types:multipart/form-data; boundary=----FormBoundaryname-- Original filename suggestion in some contexts
Why Correct MIME Types Matter
Browsers use MIME types, not file extensions, to decide how to handle a response:
- Wrong MIME type for CSS -- If a server sends
text/plainfor a.cssfile, the browser will refuse to apply the styles and log a MIME type mismatch error. - Wrong MIME type for JavaScript -- Serving
.jsfiles astext/plaincauses the browser to reject the script in strict MIME checking mode. - Security:
X-Content-Type-Options: nosniff-- When this header is set, the browser strictly enforces MIME types and will not "sniff" the content to guess the type, making correct configuration essential.
application/octet-stream as Default
When a server does not know the file type, it uses application/octet-stream as a generic binary type. This tells the browser to download the file rather than trying to display it. Configuring specific MIME types for known extensions avoids this fallback behavior.
Vendor and Personal MIME Types
MIME types use naming conventions to indicate their registration status:
| Prefix | Meaning | Example |
|---|---|---|
| (none) | Standard registered type | application/json |
vnd. | Vendor-specific type | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (.xlsx) |
x- | Unregistered experimental (deprecated) | application/x-www-form-urlencoded |
prs. | Personal/experimental | text/prs.lines.tag |
Practical Tips for MIME Type Configuration
The most common MIME type configuration mistake is not configuring them at all. Most web servers ship with a default set of mappings, but they often lag behind modern file formats. If you are serving .woff2 fonts, .webp or .avif images, or .mjs ES module files, check that your server has the correct mappings. In nginx, these mappings live in the mime.types file. In Apache, they are in mime.types or configured via AddType directives. A missing mapping means the server falls back to application/octet-stream, which triggers a download prompt instead of inline rendering.
When building APIs, always set the Content-Type header explicitly in your response rather than relying on framework defaults. If your API returns JSON, set Content-Type: application/json; charset=utf-8. If it returns XML, use application/xml. For APIs that can return multiple formats based on the Accept header (content negotiation), make sure each format has the correct MIME type. A mismatch between the declared type and the actual body format is a common cause of parsing errors on the client side.
For file upload validation, never rely solely on the MIME type sent by the client. The Content-Type in a multipart upload is set by the browser based on the file extension, and it can be easily spoofed. A malicious user can upload an executable file with a .jpg extension and the browser will send image/jpeg as the type. Always validate the actual file content (magic bytes) on the server side in addition to checking the declared MIME type.
Frequently Asked Questions
What is the correct MIME type for JavaScript: application/javascript or text/javascript?
application/javascript is the standard registered type (RFC 4329). However, text/javascript is listed as the only JavaScript MIME type in the HTML spec, and all browsers support it. In practice, both work. If you are configuring a new server, either is acceptable, though text/javascript has broader legacy compatibility.
Should I use image/svg+xml or image/svg for SVG files?
Always use image/svg+xml. The +xml suffix indicates that SVG is an XML-based format. image/svg is not a registered MIME type and may not be recognized by browsers or validators.
What MIME type should I use for JSON API responses?
Use application/json. This is the standard MIME type defined in RFC 8259. Some APIs also use application/vnd.api+json for JSON:API format or application/problem+json for RFC 7807 error responses.
What is the difference between text/xml and application/xml?
Both are valid for XML content, but application/xml is recommended for general use. The text/xml type implies the content is human-readable text, and older specs say it should default to US-ASCII encoding if no charset is specified. application/xml defaults to UTF-8, which is almost always what you want.
How do I determine the MIME type of an unknown file?
On Linux and macOS, the file command can detect the type from the file's content (magic bytes): file --mime-type unknown.bin. This is more reliable than relying on the extension. On the web, the browser sends the MIME type based on the extension, which may not match the actual content.
Why does my font file download instead of loading in the browser?
Your server is likely sending the font with application/octet-stream because it does not have a mapping for the font extension. Add the correct MIME type mapping: font/woff2 for .woff2, font/woff for .woff, font/ttf for .ttf, and font/otf for .otf. After adding the mapping, the browser will load the font inline instead of prompting a download.
Related Tools
- HTTP Header Formatter - Format Content-Type and other HTTP headers
- HTTP Status Code Lookup - Look up status codes returned alongside MIME type headers
- CORS Header Explainer - Understand CORS rules for different content types
- curl Command Builder - Build curl commands with correct Content-Type headers
- User-Agent Parser - Parse User-Agent strings to check browser MIME type support