text/html
The MIME type for HTML documents, the standard markup language for web pages.
What Is This?
The text/html MIME type indicates that the content is an HTML document. When a browser receives text/html, it parses and renders the content as a web page, executing embedded CSS and JavaScript. It is the primary content type of the World Wide Web.
Common Uses
Serving web pages from web servers
Email body content in HTML format
Documentation and help pages
Server-rendered web applications
Examples
Supported by all browsers. HTML is the foundational language of the web.
The .html file extension maps to text/html as its MIME type.
Related Entries
More from this reference:
text/plain
The MIME type for plain text files with no formatting or markup.
text/css
The MIME type for Cascading Style Sheets used to style HTML documents.
text/javascript
The MIME type for JavaScript source files used to add interactivity to web pages.
text/csv
The MIME type for Comma-Separated Values data files.
Frequently Asked Questions
What is the difference between text/html and application/xhtml+xml?
text/html is the standard for HTML documents and is more forgiving of syntax errors. application/xhtml+xml requires strict XML parsing and will fail on malformed markup. Most websites use text/html.
Should I use text/html or text/plain for HTML?
Always use text/html. Using text/plain will cause the browser to display the HTML source code as plain text instead of rendering the page.