What is a .html file?
HyperText Markup Language · Code and data · Tim Berners-Lee / W3C · 1993
HTML is the language of web pages. It uses tags to describe headings, paragraphs, links and images, and every browser turns it into the pages you read. An HTML file is plain text that you can open and edit anywhere.
What is a .html file used for?
HTML marks up content with tags so a browser knows what is a heading, a paragraph, a link or an image. It is the structural layer of every website.
On its own it handles structure, with CSS adding style and JavaScript adding behaviour. A saved .html file opens straight into any browser.
Because it is plain text, you can view and edit HTML in any code editor, which is how the web stays open and inspectable.
What opens a .html file?
The .html format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- Any browser
- VS Code
- Notepad++
macOS
- Any browser
- VS Code
Linux
- Any browser
- VS Code
Web
- Every browser renders HTML
Open a .html file step by step
- Confirm the file really is a .html. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with Any browser or VS Code.
- On Mac, use Any browser or VS Code.
- On Linux, try Any browser or VS Code.
- Still stuck? Convert the .html to PDF, which opens more widely.
Why can't I open my .html file?
Almost always because no installed app understands HTML. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .html at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
How to convert a .html file
You can convert a .html file to PDF, TXT, MD using a conversion tool or the export menu of an app that opens it.
What is the .html file signature (magic bytes)?
A .html file starts with the hex bytes 3C 21 44 4F 43 54 59 50 45, which read as <!DOCTYPE in ASCII. Programs identify HTML by those bytes, not by the filename, so a renamed file still gives itself away.
These are the documented signatures for HTML.
| Hex signature | Offset | ASCII | Note |
|---|---|---|---|
| 3C 21 44 4F 43 54 59 50 45 | 0 | <!DOCTYPE | '<!DOCTYPE' |
| 3C 68 74 6D 6C | 0 | <html | '<html' |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .html file?
HTML is the language of web pages. It uses tags to describe headings, paragraphs, links and images, and every browser turns it into the pages you read. An HTML file is plain text that you can open and edit anywhere.
How do I open an HTML file?
Double-click it to view in your browser, or open it in a code editor like VS Code to see and change the source.
Related formats
Sources
Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.