bjtrb

Mime Types

Look up the MIME type (Content-Type) for a file extension, or find which extensions use a given MIME type. The table covers the formats web developers meet most — web pages, scripts, data, images, fonts, audio, video, documents and archives — with notes on charset, legacy types and how to configure your server.

MIME type lookup

ExtensionMIME typeDescription

Web Server Headers & MIME Reference

Printable MIME types chart for web developers, HTTP security headers cheat sheet, caching headers reference and a deployment headers checklist.

Formats: PDF, XLSX, DOCX. Instant download after payment (link valid 72 hours, up to 5 downloads). AI-assisted: the templates were drafted with AI help and reviewed and laid out by Kedop.

$3.00 USD, one-time

Secure card checkout by Stripe. Full refund within 7 days — see the refund policy and license.

What a MIME type is

A MIME type (also called a media type or content type) is a label such as text/html or image/png that tells software what kind of data a file or message contains. It has a type and a subtype separated by a slash, and sometimes parameters such as charset=utf-8. Web servers send it in the Content-Type HTTP header, and browsers use it — not the file extension — to decide whether to render a page, run a script, display an image or offer a download. The official list of media types is maintained by IANA.

The top-level types

TypeContainsExamples
textHuman-readable texttext/html, text/css, text/csv, text/plain
imageImagesimage/png, image/jpeg, image/webp, image/svg+xml
audioSoundaudio/mpeg, audio/ogg, audio/wav
videoVideovideo/mp4, video/webm
fontFont filesfont/woff2, font/ttf
applicationEverything else, including binary and structured dataapplication/json, application/pdf, application/zip
multipartSeveral parts in one messagemultipart/form-data (file uploads)

MIME types web developers need most

FileContent-Type
.htmltext/html; charset=utf-8
.csstext/css
.js / .mjstext/javascript
.jsonapplication/json
.svgimage/svg+xml
.webpimage/webp
.avifimage/avif
.woff2font/woff2
.wasmapplication/wasm
.webmanifestapplication/manifest+json
.xml / sitemapapplication/xml
.pdfapplication/pdf
Unknown binaryapplication/octet-stream

For JavaScript, text/javascript is the current standard (RFC 9239); application/javascript is still widely seen and accepted. For icons, image/vnd.microsoft.icon is registered but image/x-icon is common in practice.

Why the correct MIME type matters

Setting MIME types on common servers

Nginx reads mime.types and you can add entries in a types { } block, for example application/manifest+json webmanifest;. Apache uses AddType application/wasm .wasm in the configuration or .htaccess. Node.js frameworks usually rely on a MIME library; set res.type() or the Content-Type header explicitly for custom responses. Static hosting and CDNs generally detect types from extensions; check the response headers in your browser’s developer tools (Network tab) to confirm.

Charset and text types

Text-based types should declare their character encoding, almost always UTF-8: Content-Type: text/html; charset=utf-8. Without it, browsers may guess and display accented characters incorrectly. JSON is defined as UTF-8 by its standard, so a charset parameter is not required, though it is harmless.

Worked example

After deploying a progressive web app, the browser console warns that the manifest has the wrong MIME type and WebAssembly fails to stream. Looking up .webmanifest gives application/manifest+json and .wasm gives application/wasm. Adding both to the server’s MIME configuration and redeploying fixes the warnings, and X-Content-Type-Options: nosniff is added so browsers never guess.

Uploads and user files

Never trust the MIME type or extension of a file a user uploads — both are chosen by the client. Validate uploads on the server by checking the file’s actual content (magic bytes), restrict the types you accept, and serve user uploads with Content-Disposition: attachment or from a separate domain, so a disguised HTML or SVG file cannot run scripts on your site.

MIME types in email and APIs

MIME was originally designed for email — the name stands for Multipurpose Internet Mail Extensions — and it is still how email clients know that an attachment is a PDF or an image. Multipart emails use multipart/mixed or multipart/alternative to hold several parts, such as plain-text and HTML versions of the same message. In APIs, clients send an Accept header listing the types they can handle, and servers reply with a matching Content-Type; APIs often use vendor types such as application/vnd.example+json for versioning.

Structured syntax suffixes

Many types end in a suffix such as +json, +xml or +zip, which tells software the underlying format even if it does not know the specific type. application/ld+json is JSON, image/svg+xml is XML, and application/epub+zip is a ZIP archive. Generic tools can therefore still parse or inspect the content.

Privacy

The lookup table is built into this page; searches run in your browser and nothing is sent to a server.

Frequently asked questions

What is the MIME type for JSON?

application/json.

What is the MIME type for JavaScript?

text/javascript is the current standard; application/javascript is also accepted.

What MIME type should I use for unknown files?

application/octet-stream, which tells browsers to download the file.

What is the MIME type for .docx?

application/vnd.openxmlformats-officedocument.wordprocessingml.document.

What does X-Content-Type-Options: nosniff do?

It stops browsers guessing a file’s type, so scripts and styles must be served with the correct type.

Who maintains MIME types?

IANA keeps the official media types registry.

What MIME type is used for form uploads?

multipart/form-data for forms that include files; application/x-www-form-urlencoded for simple forms.

Is the file extension enough to know the type?

Usually for serving your own files, but never for user uploads — check the content.