ToolActToolAct

MIME Types Reference

Quick lookup for file extension MIME types with search and category filtering

Total 115 个类型

Document(17)

.pdf

application/pdf

.doc

application/msword

.docx

application/vnd.openxmlformats-officedocument.wordprocessingml.document

.xls

application/vnd.ms-excel

.xlsx

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

.ppt

application/vnd.ms-powerpoint

.pptx

application/vnd.openxmlformats-officedocument.presentationml.presentation

.txt

text/plain

.rtf

application/rtf

.odt

application/vnd.oasis.opendocument.text

.ods

application/vnd.oasis.opendocument.spreadsheet

.odp

application/vnd.oasis.opendocument.presentation

.csv

text/csv

.json

application/json

.xml

application/xml

.html

text/html

.htm

text/html

Image(15)

.jpg

image/jpeg

.jpeg

image/jpeg

.png

image/png

.gif

image/gif

.webp

image/webp

.svg

image/svg+xml

.ico

image/x-icon

.bmp

image/bmp

.tiff

image/tiff

.tif

image/tiff

.avif

image/avif

.heic

image/heic

.heif

image/heif

.psd

image/vnd.adobe.photoshop

.raw

image/raw

Audio(10)

.mp3

audio/mpeg

.wav

audio/wav

.ogg

audio/ogg

.m4a

audio/mp4

.flac

audio/flac

.aac

audio/aac

.wma

audio/x-ms-wma

.aiff

audio/aiff

.mid

audio/midi

.midi

audio/midi

Video(12)

.mp4

video/mp4

.webm

video/webm

.avi

video/x-msvideo

.mov

video/quicktime

.wmv

video/x-ms-wmv

.flv

video/x-flv

.mkv

video/x-matroska

.m4v

video/mp4

.mpeg

video/mpeg

.mpg

video/mpeg

.3gp

video/3gpp

.m2ts

video/mp2t

Archive(9)

.zip

application/zip

.rar

application/vnd.rar

.7z

application/x-7z-compressed

.tar

application/x-tar

.gz

application/gzip

.bz2

application/x-bzip2

.xz

application/x-xz

.iso

application/x-iso9660-image

.dmg

application/x-apple-diskimage

Code(31)

.js

application/javascript

.mjs

application/javascript

.ts

application/typescript

.tsx

application/typescript

.jsx

application/javascript

.css

text/css

.scss

text/x-scss

.sass

text/x-sass

.less

text/x-less

.py

text/x-python

.java

text/x-java

.c

text/x-c

.cpp

text/x-c++

.h

text/x-c

.hpp

text/x-c++

.cs

text/x-csharp

.go

text/x-go

.rs

text/x-rust

.rb

text/x-ruby

.php

text/x-php

.swift

text/x-swift

.kt

text/x-kotlin

.sql

application/sql

.sh

application/x-sh

.bash

application/x-sh

.yaml

application/x-yaml

.yml

application/x-yaml

.toml

application/toml

.ini

text/x-ini

.vue

text/x-vue

.svelte

text/x-svelte

Font(5)

.woff

font/woff

.woff2

font/woff2

.ttf

font/ttf

.otf

font/otf

.eot

application/vnd.ms-fontobject

Other(16)

.exe

application/vnd.microsoft.portable-executable

.msi

application/x-msi

.apk

application/vnd.android.package-archive

.ipa

application/octet-stream

.deb

application/vnd.debian.binary-package

.rpm

application/x-rpm

.jar

application/java-archive

.war

application/java-archive

.swf

application/x-shockwave-flash

.crx

application/x-chrome-extension

.xpi

application/x-xpinstall

.torrent

application/x-bittorrent

.ics

text/calendar

.vcf

text/vcard

.epub

application/epub+zip

.mobi

application/x-mobipocket-ebook

What is a MIME Type?

MIME types (Multipurpose Internet Mail Extensions) are an internet standard for indicating the nature and format of documents, files, or byte streams. Browsers and servers use MIME types to determine how to handle received content. For example, when a browser receives image/jpeg, it displays an image; application/pdf might open a PDF preview. Setting correct MIME types is crucial for web applications to function properly. MIME types describe what kind of content a file or HTTP response contains, such as text/html, application/json, image/png, or application/pdf. They affect browser rendering, downloads, API parsing, upload validation, caching, and security behavior. File extension and MIME type do not always match, so checking them matters when diagnosing server configuration, unknown files, or upload problems. For security, MIME types should not be trusted blindly; content inspection, extension rules, and an explicit allowlist should be used together.

How to Use

Quick Reference

  1. Use the search box to find specific extensions or MIME types
  2. Click category tags to filter by file type category
  3. Click 'Ext' or 'MIME' buttons to copy corresponding content
  4. Browse categories for quick lookup: documents, images, audio, video, archives, code, fonts, etc.

Lookup Notes

  • MIME types are conventions used by servers, browsers, and applications; file extension alone is not proof of actual content.
  • For uploads and security checks, validate both declared MIME type and file signature when possible.

Use Cases

Look up MIME types by extensionSearch extensions or MIME strings across documents, images, audio, video, archives, code files, fonts, and other common file types. Results remain grouped by category when the all filter is active, making broad browsing easier than a single flat table. The full-text search works on both the extension (png, webp, json) and the MIME value (image/png, application/json) so the same lookup handles either starting point.
Copy upload and response header valuesEach card lets you copy either the extension or the MIME value, which is handy when configuring file upload accept lists, Content-Type headers, storage metadata, CDN rules, or backend validation maps. The reference is embedded in the page, so it works offline and on internal laptops that do not have internet access to IANA's registry. The copy button writes the literal value to the clipboard without trailing whitespace or quotes.
Check category coverage while building file featuresThe category filters and result count help product and engineering teams decide what file families a feature currently recognizes. It is a quick reference for common formats rather than a complete standards registry. A small gap in the archive or font section often points to a feature that is silently rejecting uploads.
Build Content-Type headers for REST API responsesCopy exact values like application/vnd.api+json or application/x-ndjson into response.setHeader() calls. Cross-check unusual suffixes against the category filter so JSON-LD, GeoJSON, or WebAssembly responses are not mistaken for plain text. The vendor-specific +json and +xml conventions (RFC 6839) carry meaningful information about the payload structure, so a typo here usually breaks a client parser.
Cover IANA, x-prefix experimentals, and content sniffingThe IANA registry is the canonical source for registered MIME types, but it does not list every working value: experimental entries use the x- prefix (application/x-tar, application/x-rar-compressed) and have never been standardized, even though they appear in nginx and Apache mime.types files. For security, content sniffing (reading the magic bytes at the start of a file) is more reliable than trusting the declared Content-Type header, and modern browsers ship X-Content-Type-Options: nosniff to disable the legacy sniffing fallback. Use the lookup table to find a header value, then validate the actual bytes on the server before serving the file.

Technical Principle

MIME types (Multipurpose Internet Mail Extensions) are standardized identifiers for data formats, originally defined in RFC 2045/RFC 2046 for email attachments and later adopted by HTTP (RFC 7231 §3.1.1.5) for web content negotiation. A MIME type is structured as type/subtype — the type declares the broad category (text, image, audio, video, application, multipart, font, model) and the subtype specifies the exact format (e.g., text/html, image/png, application/json). Optional parameters follow a semicolon (text/html; charset=utf-8). The Internet Assigned Numbers Authority (IANA) maintains the official MIME type registry at iana.org/assignments/media-types. Registration follows RFC 6838, which defines a review process requiring a specification document, security considerations, and interoperability notes. Unregistered types can use the x- prefix (e.g., application/x-tar) as a convention for experimental or vendor-specific formats, though RFC 6648 recommends avoiding the x- prefix in favor of proper registration. In HTTP, the Content-Type header tells the client how to interpret the response body. A server returning Content-Type: image/svg+xml triggers the browser's SVG renderer; Content-Type: application/octet-stream triggers a download prompt because the browser cannot determine the format. The browser also uses MIME type information for MIME sniffing — when a server omits Content-Type or sends a generic type, the browser may inspect the first few bytes of the response (magic bytes) to guess the actual format. This behavior is controlled by the X-Content-Type-Options: nosniff header, which disables sniffing and requires the server to declare the correct type. For file uploads, the Accept header tells the server what MIME types the client expects in response, while the input element's accept attribute restricts the file picker to specific types (e.g., accept="image/png, image/jpeg"). On the server side, uploaded files should be validated by both their declared MIME type and their file signature (magic bytes), as neither alone is trustworthy — a file named image.png with Content-Type: image/png could contain executable code. The tool serves as a reference for looking up the canonical MIME type for a given file extension, covering 100+ common formats across eight categories.

  • RFC 2046 structure: type/subtype — the type indicates the broad content category and the subtype the exact format; optional parameters follow a semicolon (text/html; charset=utf-8) and are case-insensitive by spec, though lowercase is the convention.
  • IANA registration (RFC 6838): New media types require a specification document, security considerations section, and interoperability notes — the review process ensures types are well-documented and conflicts are avoided before they enter the registry.
  • HTTP Content-Type header: The server declares the MIME type of the response body; browsers use it to select the appropriate renderer (HTML parser, image decoder, PDF viewer) or trigger a download — an incorrect Content-Type is the most common cause of 'file downloads instead of displaying' bugs.
  • MIME sniffing and X-Content-Type-Options: When Content-Type is missing or generic, browsers may inspect magic bytes to guess the format — X-Content-Type-Options: nosniff disables this behavior and requires an exact Content-Type match, which is a security best practice.
  • application/octet-stream: The generic binary fallback type — browsers treat it as an opaque stream and trigger a download, making it the safest default when the server cannot determine the format, but it prevents in-browser preview of otherwise displayable content.
  • File upload validation: The input accept attribute filters the file picker client-side, but server-side validation must check both the declared Content-Type and the file's magic bytes — a mismatch between extension, MIME type, and file signature is a red flag for malicious uploads.
  • Vendor-specific and experimental types: The x- prefix convention (application/x-tar, video/x-matroska) predates the formal registration process — RFC 6648 recommends migrating these to proper IANA-registered types where possible, but many remain in widespread use.

Examples

Nginx mime.types configuration

types {
  text/html             html htm;
  image/jpeg            jpg jpeg;
  application/pdf       pdf;
  application/javascript js;
}

Note: each line maps a MIME type to one or more file extensions; Nginx serves the type in the Content-Type header
IANA: https://www.iana.org/assignments/media-types/ maintains the official registry

HTTP Content-Type response header

Content-Type: application/json; charset=utf-8

Note: charset is optional but recommended for text/* and application/json; clients use it to decode the body correctly
RFC: RFC 7231 section 3.1.1.5 defines Content-Type header semantics
MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type

Browser Blob constructor

const blob = new Blob([data], { type: 'application/pdf' });
const url  = URL.createObjectURL(blob);

Note: the type becomes the Content-Type when the blob is later downloaded or uploaded; pick a specific subtype to avoid application/octet-stream
MDN: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob documents the type parameter

Common MIME types by category

Text:       text/plain, text/html, text/css, text/javascript, text/markdown
Image:      image/jpeg, image/png, image/gif, image/webp, image/svg+xml
Audio:      audio/mpeg, audio/wav, audio/ogg, audio/aac
Video:      video/mp4, video/webm, video/ogg
Application: application/json, application/pdf, application/xml, application/zip

IANA categorizes these in the Media Types registry under top-level type names

FAQ

What is a MIME type and why does it matter?

A MIME type (Multipurpose Internet Mail Extensions, also called media type) is a short label like text/html, image/png, or application/json that tells receiving software how to interpret a stream of bytes. Browsers, mail clients, file uploaders, and APIs all key off it to decide whether to render, download, parse, or reject content.

How is MIME type different from a file extension?

The extension is part of the filename and is purely a naming convention. The MIME type is sent over the network in the Content-Type header. They are usually consistent (.png ↔ image/png), but a server can serve any extension with any MIME type, and browsers trust the header much more than the extension. Aligning the two is good hygiene; relying on the extension for security is a bug.

What does application/octet-stream mean?

It is the generic 'arbitrary binary data' MIME type. Browsers receiving it will offer a download instead of trying to render the content. Servers fall back to it when they cannot identify the format, which usually means a missing or misconfigured MIME mapping. Replace it with the correct specific type whenever you can.

Can I trust Content-Type to validate uploaded files?

Not on its own. Anyone can claim image/png while uploading an executable. Always sniff the actual bytes (magic numbers, PNG header 89 50 4E 47, PDF header %PDF-, ZIP header PK), check the file extension, enforce a server-side allowlist, and limit file size. Browser-derived MIME on uploads is a hint, not proof.

Why does a download save the wrong filename or extension?

Browsers pick the saved name from the Content-Disposition header, the URL path, and the MIME type, in that order. If the server returns text/html for a PDF download, the browser may save it with .html. Set Content-Disposition: attachment; filename="name.pdf" and the correct application/pdf MIME type to avoid surprises.

How do I find the right MIME type for a custom or rare format?

Check the IANA media type registry first (iana.org/assignments/media-types). For unregistered or vendor-specific formats, the convention is application/vnd.* or application/x-* (e.g. application/vnd.api+json, application/x-7z-compressed). Use the closest standard match before inventing a new one.

Why do .json and .js show different MIME types?

JSON is data and uses application/json. JavaScript is executable code served as text/javascript or application/javascript (RFC 9239 made text/javascript the recommended one). Mixing them up matters: a script tag will refuse to execute application/json, and some servers reject application/javascript when they only accept the text variant.