MIME Types
Lookup MIME types and file extensions for web development and server configuration
MIME Types
Lookup MIME types and file extensions for web development and server configuration
Search for MIME Types
Enter a file extension (like "pdf" or "jpg") or search by category (like "image" or "document") to find the corresponding MIME type.
About MIME Types Tool
Lookup MIME types and file extensions for web development and server configuration. Our comprehensive reference helps developers set correct content types, configure servers, and handle file uploads properly with the right MIME type mappings.
- Complete MIME type database
- File extension lookup
- Content type reference
- Server configuration help
- Upload handling guidance
- Cross-platform compatibility
Frequently Asked Questions
What are mime types used for?
MIME types are used to tell browsers and servers how to handle a specific file or data stream. They appear in the Content-Type HTTP header and determine whether a file is displayed inline, downloaded, or processed by a plugin. Web servers use them to serve files correctly, and APIs rely on them to parse request and response bodies in the right format.
How to find the mime type of a file?
You can find the MIME type of a file using the utilAZ MIME types lookup tool by searching for the file extension. On Linux, run the 'file --mime-type filename' command. On macOS, use 'mdls -name kMDItemContentType filename'. In JavaScript, the File API provides the type property on uploaded files. For programmatic detection, libraries read the file magic numbers (first few bytes) to identify the format.
Why is the correct content type important?
Setting the correct Content-Type header is important because browsers use it to decide how to render or handle content. An incorrect type can cause images to download instead of display, scripts to be blocked for security reasons, or APIs to reject payloads. It also affects MIME sniffing behavior, where browsers may override the declared type, potentially creating XSS vulnerabilities.
How to configure mime types in nginx?
In Nginx, MIME types are defined in the mime.types file included by nginx.conf with the directive 'include mime.types;'. To add a custom type, edit mime.types or use 'types { }' blocks inside your server or location configuration. For example: types { application/wasm wasm; font/woff2 woff2; }. After changes, reload Nginx with 'nginx -s reload'.
What happens if the mime type is wrong?
If the MIME type is wrong, browsers may refuse to execute scripts (MIME type mismatch errors), display binary data as garbled text, download files instead of showing them, or block resources due to CORB (Cross-Origin Read Blocking). It can also create security vulnerabilities when browsers perform MIME sniffing and interpret content differently than intended.
