MIME Types Reference

Look up MIME types by file extension or search by type string. Covers text, image, audio, video, font, and application types.

Search for MIME types by file extension (like .png) or by type string (like application/json). Filter by category - text, application, image, audio, video, or font. Click to copy the MIME type string for your server config, API headers, or Content-Type declarations. Covers modern formats like AVIF, WebP, WOFF2, and WASM alongside all the classics.

Ad
Ad

About MIME Types Reference

What Is a MIME Type?

MIME (Multipurpose Internet Mail Extensions) types - also called media types - are standardised labels that tell software what kind of data a file contains. Every MIME type follows the format type/subtype, where the type is one of seven top-level categories (text, application, image, audio, video, font, multipart) and the subtype names the exact format. When a web server sends a file, it includes the MIME type in the HTTP Content-Type header so the browser knows how to handle it.

The system was originally defined in RFC 2046 for email attachments back in 1996, but it became the backbone of content negotiation on the web. The IANA (Internet Assigned Numbers Authority) maintains the official registry of all registered MIME types. As of 2026, the registry contains over 1,700 registered subtypes across all categories, with new types still being added regularly. RFC 6838 defines the current registration procedures, including rules for vendor-prefixed types (vnd.) and personal types (prs.).

Common Web MIME Types

ExtensionMIME TypeDescription
.htmltext/htmlHTML documents
.csstext/cssCSS stylesheets
.js / .mjstext/javascriptJavaScript files (RFC 9239 made text/javascript the sole standard type)
.jsonapplication/jsonJSON data
.xmlapplication/xmlXML documents
.svgimage/svg+xmlSVG vector images
.pngimage/pngPNG images
.jpg / .jpegimage/jpegJPEG images
.webpimage/webpWebP images (modern format)
.avifimage/avifAVIF images (next-gen format)
.gifimage/gifGIF images/animations
.icoimage/x-iconFavicon icons
.pdfapplication/pdfPDF documents
.woff2font/woff2WOFF2 web fonts (preferred format)
.wofffont/woffWOFF web fonts
.wasmapplication/wasmWebAssembly modules
.mp4video/mp4MP4 video
.webmvideo/webmWebM video
.mp3audio/mpegMP3 audio
.zipapplication/zipZIP archives

How Is a MIME Type Structured?

Every MIME type has two required parts separated by a forward slash: the top-level type and the subtype. Some types also include parameters after a semicolon. The most common parameter is charset, which specifies the character encoding. For example, text/html; charset=utf-8 tells the browser the document is HTML encoded in UTF-8. About 98.9% of websites use UTF-8 encoding as of early 2026, according to W3Techs data, making it the de facto default for text content.

Subtypes can also carry a structured syntax suffix (defined in RFC 6838), indicated by a plus sign. For instance, image/svg+xml signals that SVG files are XML-based, and application/ld+json tells clients that JSON-LD data is JSON underneath. This lets generic parsers handle the content even if they do not know the specific subtype.

Vendor-specific types use the vnd. prefix. Microsoft Office formats use this heavily - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet is the registered type for .xlsx files. These long names are cumbersome but they follow the IANA naming convention exactly.

MIME Type Categories

Top-Level TypeDescriptionExamples
textHuman-readable texttext/html, text/css, text/plain, text/csv, text/javascript
applicationBinary or structured dataapplication/json, application/pdf, application/zip
imageImage dataimage/png, image/jpeg, image/svg+xml, image/webp
audioAudio dataaudio/mpeg, audio/ogg, audio/wav
videoVideo datavideo/mp4, video/webm, video/ogg
fontFont data (added by RFC 8081)font/woff2, font/woff, font/ttf
multipartMulti-part message bodiesmultipart/form-data (file uploads)

RFC 8081 added font as a top-level type in 2017. Before that, fonts were registered under application (e.g. application/font-woff). The newer font/ prefix is now preferred for all web font types. Even more recently, RFC 9695 introduced haptics as a top-level type in March 2025 for tactile feedback data, though it has limited web relevance so far.

The JavaScript MIME Type Change (RFC 9239)

One of the most common sources of confusion is the correct MIME type for JavaScript. Historically, servers used a mix of application/javascript, text/javascript, application/x-javascript, and others. RFC 9239, published in May 2022, settled the debate: text/javascript is now the sole official MIME type for JavaScript. All others - including application/javascript - are considered obsolete aliases.

The RFC states plainly: "Servers should use text/javascript for JavaScript resources." RFC 9239 also formally registered the .mjs extension for JavaScript module files, mapping it to the same text/javascript type. Browsers still accept the old types for backward compatibility, but new server configurations should use text/javascript exclusively.

This matters for tools like Nginx, where the default mime.types file historically mapped .js to application/javascript. Several projects - including Nginx itself, Drupal, Spring Framework, and Python's standard library - have all updated their defaults in response to RFC 9239.

Why Getting the MIME Type Right Matters

Wrong MIME TypeWhat Happens
JS served as text/plainBrowser refuses to execute it (MIME type checking blocks non-script types)
CSS served as text/plainStyles are not applied; browser logs a warning
HTML served as text/plainBrowser shows raw HTML source instead of rendering the page
JSON served as text/htmlAPI clients may fail to parse the response
SVG served as text/xmlMay render but without proper CORS handling for fonts/styles
Binary served as text/htmlBrowser tries to render garbage characters; possible XSS vector

The X-Content-Type-Options: nosniff header prevents browsers from guessing the content type when it does not match the declared type. Without this header, older browsers would "sniff" the content and potentially execute a malicious file that was served as text/plain but contained HTML or JavaScript. With nosniff set, the browser strictly enforces the Content-Type header. For script and style resources, the browser blocks the response entirely if the declared MIME type is not valid for that resource type. All major browsers - Chrome, Firefox, Edge, and Safari - support nosniff. It was first introduced by Microsoft in Internet Explorer 8.

MIME Types in Server Configuration

ServerWhere to ConfigureExample
Nginxmime.types file or types {} blocktypes { text/javascript js mjs; }
Apache.htaccess or httpd.confAddType text/javascript .js .mjs
Express.jsexpress.static() or res.type()res.type('application/json')
Cloudflare PagesAutomatic based on extensionNo config needed for standard types
AWS S3Object metadataSet Content-Type when uploading objects
CaddyAutomatic from built-in tableOverride with header directive if needed

Most modern web servers and CDNs automatically map common extensions to the correct MIME types, but you may need to add entries manually for newer formats like .avif, .wasm, or .mjs. Always test by inspecting the Content-Type header in your browser's developer tools (Network tab) to confirm the server is sending the right type.

Special MIME Types

MIME TypePurposeNotes
application/octet-streamGeneric binary dataDefault for unknown file types; triggers download
multipart/form-dataFile upload formsUsed with <form enctype="multipart/form-data">
application/x-www-form-urlencodedStandard form submissionDefault for HTML forms without file uploads
text/event-streamServer-Sent EventsUsed for SSE streaming connections
application/manifest+jsonWeb App ManifestPWA configuration file
application/wasmWebAssemblyRequired for streaming compilation of .wasm files
application/ld+jsonJSON-LD structured dataUsed in <script type="application/ld+json"> for SEO

Common Mistakes with MIME Types

A few patterns come up repeatedly when debugging Content-Type problems:

Using application/javascript instead of text/javascript. Per RFC 9239, text/javascript is the correct type. While browsers still accept both, servers and linting tools are gradually flagging the old form. Update your Nginx mime.types or Apache config if it still references application/javascript.

Forgetting charset on text types. Serving text/html without charset=utf-8 can cause garbled characters on pages with non-ASCII content. Always include the charset parameter for HTML, CSS, and plain text responses. JSON does not need it because RFC 8259 requires JSON to be UTF-8 by default.

Serving .svg as image/png or application/xml. SVG files need image/svg+xml specifically. Serving them as generic XML can break inline styles and font loading. If SVGs are used as <img> sources, the correct MIME type is essential for the browser to render them properly.

Missing MIME type for .wasm files. WebAssembly requires application/wasm for streaming compilation to work. Without it, browsers fall back to ArrayBuffer compilation, which is slower and consumes more memory.

Using image/x-icon vs image/vnd.microsoft.icon. Both are used for .ico files, but neither is universally standardised. Most browsers accept image/x-icon without issue. For modern favicons, consider using image/png with a 32x32 PNG file instead.

MIME Types for Modern Web Formats

Several newer file formats have their own registered MIME types that older server configurations may not include by default:

FormatMIME TypeServer Support Notes
AVIF imagesimage/avifAdded to most servers post-2021; may need manual config on older setups
WebP imagesimage/webpWidely supported; included in default configs since ~2019
WOFF2 fontsfont/woff2Preferred web font format; some older configs still use application/font-woff2
WebAssemblyapplication/wasmRequired for streaming compilation; not in all default configs
JSON-LDapplication/ld+jsonUsed for structured data in SEO; standard JSON parser handles it
HEIC imagesimage/heicApple's photo format; limited browser support but common in file transfers

For looking up HTTP response codes alongside MIME types, the HTTP Status Codes Reference has a searchable list. For encoding binary data as text for transport, the Base64 Encoder handles that. To validate and format JSON payloads before setting the right Content-Type, the JSON Formatter is a quick way to check structure.

Sources

Frequently Asked Questions

What is a MIME type?

MIME stands for Multipurpose Internet Mail Extensions. A MIME type is a label that tells browsers and servers what kind of data a file contains, like text/html for web pages or image/png for PNG images. It is sent in the Content-Type HTTP header.

How do I find the right MIME type for my file?

Search by file extension (like .png or .json) or by the MIME type string itself. The tool covers common text, application, image, audio, video, and font types. Click Copy to grab the MIME type for your code.

Why is the correct MIME type important?

Browsers use MIME types to decide how to handle files. Serving a JavaScript file with text/plain instead of text/javascript can cause security warnings or block execution entirely. Setting the correct Content-Type header ensures files are processed correctly.

What is application/octet-stream?

This is the default MIME type for binary files when the actual type is unknown. Browsers typically treat it as a download rather than trying to display it. It is a safe fallback for arbitrary binary data.

Is this list complete?

It covers the most commonly used MIME types across web development, including modern formats like WebP, AVIF, WOFF2, and WebAssembly. For very rare or vendor-specific types, check the IANA media types registry.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/mime-types-reference/" title="MIME Types Reference - Free Online Tool">Try MIME Types Reference on ToolboxKit.io</a>