What is MIME Type?
A MIME type (media type) is a standardized label like text/html, application/json, or image/png that tells browsers and servers how to interpret a file’s contents. It appears in HTTP headers such as Content-Type.
Getting the MIME type right matters: the wrong type can cause a browser to download a file instead of displaying it, or refuse to run a script.
Key points
- A type/subtype label like text/html or application/json.
- Sent in the Content-Type HTTP header.
- Tells the browser how to interpret the response.
- The wrong type can trigger downloads or block scripts.
Example
application/json text/html image/png
Common uses
- Setting Content-Type on API responses
- Telling browsers how to render a file
- Validating uploaded file types
- Configuring static file servers