/ /MIME Type Checker
MIME Type Checker
Look up MIME types by file extension or find matching extensions by MIME type. Includes category, magic bytes (file signatures), and common uses for over 60 file formats.
Inputs
File Extension (e.g., .pdf, pdf, jpg)
Or search by MIME Type
Results
Enter a file extension or MIME type to see results.
Related Tools
References
Frequently Asked Questions
- What is a MIME type?
- A MIME type (Multipurpose Internet Mail Extensions) is a two-part identifier string that tells a browser or application what kind of data a file contains. It follows the format "type/subtype" such as "text/html" or "image/jpeg". MIME types are essential for proper content negotiation between servers and clients on the web.
- How does the Content-Type header work?
- The Content-Type header in HTTP responses tells the browser the MIME type of the returned resource. For example, "Content-Type: text/html; charset=utf-8" tells the browser the content is HTML with UTF-8 encoding. Servers set this header based on file extension or content inspection, and browsers use it to determine how to render or download the content.
- What is the difference between primary and subtype in a media type?
- The primary type (e.g., text, image, audio, video, application) represents the general category of data. The subtype specifies the exact format within that category (e.g., text/html, text/css, text/plain). The combination creates a unique identifier. Common primary types include text, image, audio, video, application, multipart, message, model, and font.
- Where does the IANA maintain MIME types?
- The Internet Assigned Numbers Authority (IANA) maintains the official registry of all MIME types at https://www.iana.org/assignments/media-types/. IANA reviews and approves new media types through a standardization process. The registry includes the type, subtype, required parameters, encoding considerations, and security considerations for each registered media type.
- What is browser MIME sniffing and why is it a security risk?
- MIME sniffing (or content sniffing) is when a browser ignores the Content-Type header and tries to detect the actual file type by examining the file content (magic bytes). This can be exploited: an attacker could upload a malicious script disguised as an image. Modern browsers support the X-Content-Type-Options: nosniff header to disable MIME sniffing and enforce the declared Content-Type.
- How should I validate file upload MIME types on the server?
- Never trust the client-provided Content-Type or file extension alone. Use server-side validation that checks the file's magic bytes (file signatures) using tools like libmagic, file command, or libraries like file-type for Node.js. Validate both the extension against an allowlist and the actual content signature. Store files with safe names and serve with correct MIME types.
- What are magic bytes and how do file signatures work?
- Magic bytes are the first few bytes of a file that uniquely identify its format. For example, PDF files start with "%PDF" (25 50 44 46 in hex), PNG files with ".PNG" (89 50 4E 47), and ZIP files with "PK" (50 4B). Operating systems and applications use these signatures to determine file type even when the extension is missing or wrong.
- Why does my browser download a file instead of displaying it?
- This happens when the server sends an incorrect or generic Content-Type header (like application/octet-stream) or when the browser cannot handle the MIME type natively. Fix this by configuring your server to serve files with the correct MIME types. Common examples: CSS files should be text/css, JavaScript as application/javascript, and images with their respective image/* types.
- What is the application/octet-stream MIME type?
- application/octet-stream is the generic binary data MIME type. It tells the browser "this is binary data, treat it as a file download." It is used when the server cannot determine the exact file type or for binary files without a specific MIME type. When served, browsers typically show a download prompt rather than attempting to display the content.
- How do I add custom MIME types to my web server?
- For Apache, add "AddType" directives in .htaccess or httpd.conf (e.g., "AddType application/wasm .wasm"). For Nginx, use the "types" block or "mime.types" include file. For IIS, configure MIME types in the web.config file or through the IIS Manager GUI. Node.js/Express uses the mime package or mime-types. Always restart your server after changes.
- What are the most common MIME types for web development?
- Essential MIME types: text/html for pages, text/css for stylesheets, application/javascript for scripts, image/jpeg, image/png, image/gif, image/svg+xml for images, application/json for API responses, font/woff2 for fonts, video/mp4 for video, audio/mpeg for audio, application/pdf for documents, and application/xml for XML data. Using correct types ensures proper rendering and security.
- Can a file have multiple valid MIME types?
- Some files can have multiple valid MIME types depending on context. For example, XML can be text/xml or application/xml. JavaScript was historically text/javascript but is now application/javascript. SVG can be image/svg+xml or application/xml. JSON is always application/json, but some legacy systems used text/json. Always prefer the official IANA-registered type for consistency.
- How do MIME types relate to email attachments?
- MIME types originated from email (RFC 2045-2049) to allow multipart messages with attachments. Email uses Content-Type headers to specify the format of each part: text/plain for body text, image/jpeg for attached images, application/pdf for documents. Multipart/mixed emails combine different content types in a single message. The Content-Disposition header controls whether parts display inline or as attachments.
- What is the difference between MIME type and file extension?
- A MIME type is a standardized identifier (like "image/png") that describes the data format, while a file extension (like ".png") is a naming convention for filenames. Extensions are platform-specific and can be misleading or missing. MIME types are the definitive way to identify content type on the web. Servers map extensions to MIME types, but the actual content determined by magic bytes may differ from the extension.