Category: Text

text/html

text/html is the foundational MIME type of the World Wide Web, telling browsers to interpret the payload as an interactive DOM document.

MIME / CONTENT-TYPE

text/html

ASSOCIATED EXTENSIONS

.html, .htm

PRIMARY CATEGORY

Text

HTTP Headers & Web Server Configurations

Standard HTTP Response Header
Content-Type: text/html; charset=utf-8

Send this exact header in HTTP responses to instruct browsers how to decode and render the payload.

Node.js / Express / Web API
res.setHeader("Content-Type", "text/html; charset=utf-8"); res.send("<!DOCTYPE html><html><body><h1>Hello World</h1></body></html>");
NGINX Configuration (mime.types)
types { text/html html htm; }
Apache (.htaccess / httpd.conf)
AddType text/html .html

Security Advisory & Hardening

Always specify charset=utf-8 to prevent UTF-7 XSS vulnerabilities. Enforce Content-Security-Policy (CSP) headers to block malicious script execution.

Frequently Asked Questions

text/html Questions & Answers

Common questions regarding MIME types, Content-Type headers, and web server configurations.

The standard HTTP response header is: "Content-Type: text/html; charset=utf-8".