Understanding HTTP MIME Types
The internet hosts many kinds of resources, so each resource needs a label to tell clients how to handle it. MIME (Multipurpose Internet Mail Extensions) was originally developed to solve problems moving data between different mail systems, and the same concept is used by HTTP to indicate the media type of a resource.
MIME types are written as type/subtype.
Type
- The type indicates the broad category of the data, for example:
text,image,video,audio,application(binary or structured data), andmultipart(multiple parts in a single message). - These categories are formally defined in standards such as RFC 2046.
Subtype
- The subtype specifies the exact format inside the main type, for example:
html,css,png,json. - Together the
type/subtypepair precisely identifies the resource format (for example,text/html).
Common MIME types
- text/*
text/plain— plain texttext/html— HTML documentstext/css— CSS stylesheetstext/javascript(historical) orapplication/javascript— JavaScripttext/event-stream— Server-Sent Events (SSE)
- image/*
image/jpeg— JPEG imagesimage/png— PNG imagesimage/gif— GIF images (supports animation)image/webp— WebP images
- audio/*
audio/mpeg— MP3 audioaudio/wav— WAV audioaudio/ogg— Ogg audioaudio/webm— WebM audioaudio/aac— AAC audioaudio/flac— FLAC (lossless) audio
- video/*
video/mp4— MP4 videovideo/webm— WebM videovideo/ogg— Ogg video
- application/*
application/json— JSON dataapplication/xml— XML dataapplication/pdf— PDF documentsapplication/octet-stream— arbitrary binary data (default for unknown binaries)application/zip— ZIP archives
- multipart/*
multipart/form-data— used for form submissions that include filesmultipart/byteranges— multiple byte ranges in a single response
HTTP usage
- Servers send the MIME type in the
Content-Typeresponse header so browsers and other clients know how to process the payload. Example:Content-Type: text/html; charset=utf-8




