Ctrl + K
HTTP7 min read

MIME Types Cheat Sheet

Quickly find common MIME types, understand when to use them and learn best practices for setting Content-Type headers correctly.

Published: 2026-08-07

MIME types, also known as media types, identify the format of data transmitted over HTTP. They are used by the Content-Type header to tell browsers, APIs and other clients how a request or response body should be interpreted. Using the correct MIME type is essential for compatibility, security and predictable application behavior.

This cheat sheet collects the MIME types developers encounter most frequently when building websites, REST APIs, file upload systems and web applications. Instead of memorizing every value, you can use this guide as a quick reference whenever you need the correct Content-Type.

What Is a MIME Type?

A MIME type is a standardized identifier consisting of a type and subtype separated by a slash. For example, application/json identifies JSON data, while image/png identifies PNG images.

type/subtype

Most Common MIME Types

MIME TypeTypical Usage
text/htmlHTML pages
text/plainPlain text
text/cssCSS stylesheets
application/jsonREST APIs
application/xmlXML documents
application/pdfPDF files
application/javascriptJavaScript files

Image MIME Types

FormatMIME Type
PNGimage/png
JPEGimage/jpeg
GIFimage/gif
SVGimage/svg+xml
WebPimage/webp
AVIFimage/avif
ICOimage/x-icon

Audio MIME Types

FormatMIME Type
MP3audio/mpeg
WAVaudio/wav
OGGaudio/ogg
AACaudio/aac
WebM Audioaudio/webm

Video MIME Types

FormatMIME Type
MP4video/mp4
WebMvideo/webm
OGGvideo/ogg
AVIvideo/x-msvideo
MPEGvideo/mpeg

Document MIME Types

DocumentMIME Type
PDFapplication/pdf
DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
XLSXapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
PPTXapplication/vnd.openxmlformats-officedocument.presentationml.presentation
CSVtext/csv
RTFapplication/rtf
💡 When serving files from a web server, always use the official MIME type instead of relying solely on the file extension.
⚠️ An incorrect MIME type may cause browsers to display, download or execute content differently than intended.

Archive MIME Types

Archive FormatMIME Type
ZIPapplication/zip
RARapplication/vnd.rar
7Zapplication/x-7z-compressed
TARapplication/x-tar
GZIPapplication/gzip

Font MIME Types

Modern websites commonly load custom fonts through CSS. Returning the correct MIME type helps browsers recognize and cache font files efficiently.

Font FormatMIME Type
WOFFfont/woff
WOFF2font/woff2
TTFfont/ttf
OTFfont/otf

Form Submission MIME Types

HTML forms submit data using different Content-Type values depending on how the form is configured. File uploads require multipart/form-data, while standard forms often use application/x-www-form-urlencoded.

Form TypeContent-Type
Standard HTML formapplication/x-www-form-urlencoded
File uploadmultipart/form-data
JavaScript JSON requestapplication/json

API MIME Types

Modern APIs primarily exchange structured data. JSON has become the dominant format, although XML is still widely used by legacy systems and enterprise integrations.

API FormatMIME Type
JSONapplication/json
JSON-LDapplication/ld+json
XMLapplication/xml
SOAP XMLtext/xml

Text MIME Types

ContentMIME Type
Plain texttext/plain
HTMLtext/html
CSStext/css
CSVtext/csv
Markdowntext/markdown
Calendartext/calendar

Binary MIME Types

Some files do not have a specific standardized MIME type or represent arbitrary binary data. In these situations, servers commonly return application/octet-stream, which tells browsers that the content should generally be treated as a downloadable binary file.

Content-Type: application/octet-stream

Choosing the Correct MIME Type

Selecting the correct MIME type depends on the actual content rather than the file extension alone. Servers should identify the real format of the resource and return the matching Content-Type value to ensure browsers and applications process it correctly.

ScenarioRecommended MIME Type
REST API responseapplication/json
Website homepagetext/html
CSS stylesheettext/css
SVG iconimage/svg+xml
File downloadapplication/octet-stream (when appropriate)

Common MIME Type Mistakes

  • Serving JSON as text/plain.
  • Returning HTML with application/json.
  • Using outdated JavaScript MIME types.
  • Serving SVG as text/plain instead of image/svg+xml.
  • Assuming browsers will always guess the correct content type.
  • Configuring servers based only on file extensions without verification.
💡 Keeping a small MIME type reference nearby saves time when configuring web servers, APIs and file download endpoints.
⚠️ Incorrect MIME types can cause broken page rendering, failed API requests, download problems and unnecessary browser security warnings.

MIME Types and HTTP Headers

MIME types are most commonly used with the HTTP Content-Type header. When a client sends data to a server or receives a response, the Content-Type header specifies which MIME type describes the message body. This allows browsers, APIs and other applications to process the content correctly.

MIME Types and Security

Accurate MIME types improve security by reducing ambiguity. Browsers rely on the declared media type when deciding how to handle content, and incorrect values may lead to rendering issues or MIME sniffing. Many web servers also send the X-Content-Type-Options: nosniff header to instruct browsers not to guess the content type.

How Web Servers Determine MIME Types

Most web servers automatically assign MIME types based on configured mappings between file extensions and media types. Dynamic applications often set the Content-Type header programmatically before sending a response, allowing APIs and generated content to specify the correct media type regardless of file names.

Frequently Used Developer MIME Types

TechnologyCommon MIME Type
JSON APIapplication/json
HTMLtext/html
CSStext/css
JavaScriptapplication/javascript
SVGimage/svg+xml
Web App Manifestapplication/manifest+json
WebAssemblyapplication/wasm

Best Practices

  • Always return the official MIME type for every resource.
  • Use application/json for REST API payloads.
  • Serve SVG files as image/svg+xml.
  • Verify server MIME mappings after deployment.
  • Use UTF-8 for modern text-based content where appropriate.
  • Enable X-Content-Type-Options: nosniff for improved browser security.
💡 If a browser displays a file incorrectly or an API rejects a request, checking the returned Content-Type header is often the quickest way to identify the problem.
⚠️ Changing a file's extension does not change its actual MIME type. Servers should identify and return the correct media type based on the content being served.

Frequently Asked Questions

What is a MIME type?

A MIME type is a standardized identifier that describes the format of transmitted data. It is commonly used in the HTTP Content-Type header so browsers and applications know how to process a resource.

What MIME type should JSON use?

JSON should be served using application/json, which is the standard media type for JSON documents and REST API payloads.

What MIME type should HTML pages use?

HTML documents should be served as text/html, typically with a UTF-8 character encoding parameter when appropriate.

What happens if the wrong MIME type is used?

Browsers or applications may render content incorrectly, refuse to process it, download it unexpectedly or trigger security protections such as MIME type validation.

Are MIME types only used by web browsers?

No. MIME types are used by browsers, APIs, web servers, email systems, file upload services and many other applications that exchange structured data.

Helpful HTTP Tools

A MIME Type Lookup helps you quickly find the correct media type for a file format, a MIME Type Detector identifies likely MIME types from uploaded content, a Content-Type Finder assists in selecting appropriate HTTP Content-Type values, an HTTP Header Viewer lets you inspect response headers returned by servers, and an HTTP Response Formatter makes API responses easier to read while verifying Content-Type information.

Conclusion

MIME types are a fundamental part of HTTP communication, allowing clients and servers to identify the format of transmitted data consistently. Whether you're serving web pages, building REST APIs, delivering images or handling file downloads, using the correct Content-Type ensures resources are interpreted correctly, improves interoperability and helps avoid compatibility and security issues. Keeping a practical MIME type cheat sheet nearby makes configuring web servers and debugging HTTP responses significantly easier.