TextText-based
text/html
HTML
Reference for text/html, the MIME type for HTML documents that form the foundation of every web page on the internet.
MIME Type Detector
Drop a file to detect its MIME type — no upload, runs in your browser
📄
Drop any file here or click to choose
Expected extensions: .html, .htm
HTTP Content-Type Header
HTTP Header
Content-Type: text/html; charset=utf-8Associated File Extensions
.html.htm
Quick Facts
| MIME Type | text/html |
| Category | Text |
| Type | Text-based (human-readable) |
| Extensions | .html, .htm |
Common Usage
HTML is the standard markup language for web pages. Every website serves HTML as the primary document type.
It structures content with semantic elements, links to CSS for styling and JavaScript for interactivity. Browsers require the text/html MIME type to render pages correctly.
Code Examples
HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.html" type="text/html">
<!-- Or for script/media elements -->
<script type="text/html" src="file.html"></script>Node.js
// Express.js
app.get('/file', (req, res) => {
res.type('text/html');
res.send(data);
});
// Node.js http
res.writeHead(200, { 'Content-Type': 'text/html' });nginx
# nginx.conf — add to types block or use default
types {
text/html html htm;
}
# Or set for a specific location
location /api/ {
default_type text/html;
}Related MIME Types
More Text MIME Types
Other text types in the Text family
Related Tools
Explore More MIME Types
Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.