Skip to content
Back to Blog
2026-06-05Web Development

Understanding File Types: MIME Types Explained

MIME (Multipurpose Internet Mail Extensions) types are standardized identifiers that specify the nature and format of a document, file, or assortment of bytes. They are essential for proper file handling on the internet.

What is a MIME Type?

A MIME type consists of two parts: a type and a subtype, separated by a slash. For example:

  • text/html — HTML document
  • application/json — JSON data
  • image/png — PNG image
  • video/mp4 — MP4 video

Why MIME Types Matter

Web servers and browsers use MIME types to determine how to handle files:

  1. Content-Type Header: Servers send the MIME type in HTTP responses
  2. File Handling: Browsers decide whether to display, download, or prompt for files
  3. Security: Incorrect MIME types can lead to security vulnerabilities
  4. Validation: Applications use MIME types to validate uploaded files

Common MIME Types

Documents

FormatMIME Type
PDFapplication/pdf
DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
TXTtext/plain
HTMLtext/html

Images

FormatMIME Type
PNGimage/png
JPEGimage/jpeg
GIFimage/gif
SVGimage/svg+xml
WebPimage/webp

Video/Audio

FormatMIME Type
MP4video/mp4
WebMvideo/webm
MP3audio/mpeg
WAVaudio/wav

MIME Type Sniffing

Browsers may "sniff" MIME types by examining file content when the Content-Type header is missing or generic. This can be controlled with the X-Content-Type-Options: nosniff header.

Testing MIME Types

When testing your application, use sample files with known MIME types to verify proper handling across your entire pipeline.

#mime#http#web#file-types