What Is a MIME Type? (Content-Type Headers Explained)
A MIME type is a label that tells software what kind of data a file or HTTP response contains — like application/json or image/png. Plain explanation with examples.
Short answer
A MIME type (also called media type or content type) is a string that identifies the format of a file or HTTP response — for example application/json for JSON, image/png for a PNG, text/html for a webpage. The browser uses this label to decide whether to display, download, or execute the content.
The format
Every MIME type has the shape type/subtype:
- Top-level type — broad category:
application,text,image,audio,video,font,multipart,message. - Subtype — specific format:
json,html,png,mp4,woff2. - Optional parameter:
; charset=utf-8for text formats,; boundary=...for multipart.
Where MIME types appear
- HTTP
Content-Typeheader — every response declares its media type - HTML
<input type="file" accept="...">— restricts file picker - Email attachments — MIME (Multipurpose Internet Mail Extensions) was originally invented for email
- Service workers + fetch API — match responses by content type
Common MIME types you'll meet
| MIME type | Used for |
|---|---|
application/json | REST API responses |
application/x-www-form-urlencoded | HTML form submissions |
multipart/form-data | Forms with file uploads |
text/html | Webpages |
text/plain | Plain text files |
image/jpeg / image/png / image/webp | Web images |
application/pdf | PDF downloads |
application/octet-stream | Generic binary "download as file" |
Full reference: HTTP MIME types reference.
Why misconfiguration breaks things
- JS file served as
text/plain— browser refuses to execute (since 2018, modern browsers requiretext/javascriptorapplication/javascript) - JSON served as
text/html— frontend'sresponse.json()may still work but security middleware (CORB) can block it - Custom font served without proper type — browsers may fall back to system fonts
- PDF served as
application/octet-stream— browser shows download dialog instead of inline viewer
Where to look up the right type
The IANA registry (iana.org/assignments/media-types) is canonical. For day-to-day reference, our HTTP MIME types reference covers the practical subset used in web development.
Related tools
Inspect API response headers + body: JSON formatter. Look up unfamiliar HTTP status codes: HTTP status codes. Encode binary content for transmission: Base64.
Featured Tools
Try these free tools directly in your browser — no sign-up required.
HTTP Status Codes
Complete HTTP status code reference with explanations, use cases, and examples. Look up any HTTP response code from 1xx informational to 5xx server errors.
JSON Formatter
Format, beautify, and validate JSON instantly. Paste raw JSON and get a clean, indented, human-readable output with syntax error detection.
Base64 Encoder / Decoder
Encode text or decode Base64 strings instantly online. Convert between plain text and Base64 encoding for data URLs, authentication headers, and API tokens.