MIME Types
Common MIME Types
Text
| MIME Type | Extension | Usage |
|---|---|---|
text/plain |
.txt |
Plain text files |
text/html |
.html |
Web pages |
text/css |
.css |
Stylesheets |
text/javascript |
.js |
JavaScript (modern standard) |
text/csv |
.csv |
Comma-separated values |
text/xml |
.xml |
XML documents |
text/markdown |
.md |
Markdown documents |
Application
| MIME Type | Extension | Usage |
|---|---|---|
application/json |
.json |
JSON data (APIs, configs) |
application/xml |
.xml |
XML data |
application/pdf |
PDF documents |
|
application/zip |
.zip |
ZIP archives |
application/gzip |
.gz |
Gzip compressed files |
application/x-tar |
.tar |
Tar archives |
application/octet-stream |
(any) |
Binary data (generic/unknown) |
application/x-yaml |
.yml/.yaml |
YAML (no official IANA type) |
application/x-www-form-urlencoded |
— |
HTML form data (default) |
multipart/form-data |
— |
File uploads in forms |
Image
| MIME Type | Extension | Usage |
|---|---|---|
image/png |
.png |
Lossless images, screenshots |
image/jpeg |
.jpg/.jpeg |
Photographs |
image/gif |
.gif |
Animated images |
image/svg+xml |
.svg |
Vector graphics |
image/webp |
.webp |
Modern web images |
Certificate and Security
| MIME Type | Extension | Usage |
|---|---|---|
application/x-pem-file |
.pem |
PEM-encoded certificates |
application/pkcs12 |
.p12/.pfx |
PKCS#12 keystores |
application/x-x509-ca-cert |
.crt/.cer |
X.509 certificates |
application/pkix-cert |
.cer |
PKIX certificate |
CLI Usage
file --mime-type document.pdf
# document.pdf: application/pdf
curl -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.com
find . -type f -exec file --mime-type {} + | awk -F: '/application\/pdf/ {print $1}'