MIME (Multipurpose Internet Mail Extensions) is a standard originally developed to support different types of content in email, including attachments, multimedia files, and non-ASCII text.
Today, MIME types are widely used in web technologies to identify the format of content exchanged between browsers, servers, and APIs.
Also known as: MIME type, Internet media type.
MIME identifies the type of data being transmitted so applications can handle it appropriately.
A MIME type usually follows this format:
type/subtype
For example:
text/html
application/json
image/jpeg
When a server returns a file, it can include a MIME type in the HTTP Content-Type header to describe the response body.
Common examples include:
MIME defines conventions for describing content formats, while Content-Type is a header field that communicates the media type of a message body.
In simple terms:
A file extension suggests the format of a file, while a MIME type explicitly identifies its media format.
For example:
File Extension: .jpg
MIME Type: image/jpeg
File extensions and declared MIME types can be incorrect, so applications should validate uploaded files when security matters.
MIME types help scraping tools determine how to process HTTP responses.
For example, a scraper may handle:
text/html using an HTML parser.application/json using a JSON parser.application/pdf using a PDF extraction tool.Checking the response's Content-Type header helps prevent parsing errors.
Suppose a browser requests an image from a web server.
The server responds with:
HTTP/1.1 200 OK
Content-Type: image/jpeg
The image/jpeg MIME type tells the browser that the response body contains a JPEG image.
The browser can then decode and display the image using the appropriate format.
MIME is a standard for identifying and exchanging different types of digital content.
Originally designed for email, MIME types are now essential to HTTP communication, APIs, and web applications. They help browsers and other clients determine how to interpret and process received data.