Explaining Content-Types

  • MIME (Multipurpose Internet Mail Extensions) defines how data is formatted and transmitted over the Internet.
  • Each content type has the form: type/subtype
  • They’re used in HTTP headers (Content-Type), email headers, and many other protocols.
  • The type is the general category (e.g., text, image, application), and the subtype specifies the exact format (e.g., html, png, json).

Example in HTTP:

Content-Type: application/json; charset=utf-8

Common MIME Content-Types

Text

  • text/plain — plain text
  • text/html — HTML documents
  • text/css — Cascading Style Sheets
  • text/javascript (old) / application/javascript (modern) — JavaScript
  • text/csv — Comma-separated values
  • text/markdown — Markdown text

Images

  • image/jpeg — JPEG images
  • image/png — PNG images
  • image/gif — GIF images
  • image/webp — WebP images
  • image/svg+xml — SVG (vector graphics, XML-based)
  • image/bmp — Bitmap
  • image/tiff — TIFF images
  • image/x-icon — ICO (favicons)

Data Interchange (Structured)

  • application/json — JSON data
  • application/xml — XML data (generic)
  • text/xml — XML data (older, treated as text)
  • application/xhtml+xml — XHTML documents

General Binary Data

  • application/octet-stream — arbitrary binary data (default if unknown)
  • application/zip — ZIP archive
  • application/gzip — Gzip-compressed data
  • application/x-tar — Tar archive
  • application/pdf — Portable Document Format
  • application/msword — Microsoft Word (legacy .doc)
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document — MS Word .docx
  • application/vnd.ms-excel — Excel (legacy .xls)
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet — Excel .xlsx
  • application/vnd.ms-powerpoint — PowerPoint (legacy .ppt)
  • application/vnd.openxmlformats-officedocument.presentationml.presentation — PowerPoint .pptx

Audio / Video

  • audio/mpeg — MP3 audio
  • audio/ogg — Ogg Vorbis audio
  • audio/wav — WAV audio
  • video/mp4 — MP4 video
  • video/x-msvideo — AVI video
  • video/webm — WebM video
  • video/quicktime — MOV/QuickTime

Multipart (for email / forms / uploads)

  • multipart/form-data — file uploads via forms
  • multipart/mixed — email with multiple attachments
  • multipart/alternative — same content in different formats (e.g., plain text + HTML email)
  • multipart/related — documents with linked resources (e.g., HTML + inline images)