File extensions

How to open a .html file

HTML document · Web / text

An .html file is a web page. Double-click it and your browser opens it. To see or change the code behind it, open the same file in a text editor instead.

What a .html file actually is

HTML is the markup language every web page is written in. A local .html file is exactly what a server would send you, just stored on your disk instead of fetched over the network.

The two things people want from an .html file are opposites: view it as a page, or read its source. Both are trivial, but they need different programs and that is where the confusion sits.

Why it will not open

Rarely does it fail to open at all. What surprises people is a saved page that renders without its images and styling, because those lived in a separate folder that was not kept alongside the file.

Renaming it to an extension you can open will not help: changing the extension does not convert the file, it only changes what Windows tries to open it with.

Step by step

Windows

  1. 01To view it: double-click, or drag it onto any browser window.
  2. 02To edit it: right-click, choose "Open with", then Notepad, VS Code or Notepad++.
  3. 03In a browser you can also press Ctrl+U to see the source of the page you are viewing.
  4. 04If images and layout are missing, look for a folder next to the file with the same name and an "_files" suffix. The page needs it.

macOS

  1. 01Double-click to open it in Safari, or drag it onto Chrome or Firefox.
  2. 02To edit, right-click, choose Open With, then TextEdit, and set Format to Plain Text so it does not save styled text.
  3. 03In Terminal, "open -a Safari file.html" opens it in a specific browser.

What usually goes wrong

TextEdit can silently ruin an HTML file

In its default rich-text mode, TextEdit renders the HTML instead of showing the code, and saving turns it into an RTF document. Choose Format, Make Plain Text before editing anything.

Programs that open .html

Our pick, in order. Every one links to the publisher's official download URL and the SHA-256 hash of the installer. Once you have downloaded it, you can check the file against our index before you run it.

If you end up downloading one of these from somewhere other than the publisher, what you can and cannot verify about that is worth two minutes.

Also registers .html in its manifest

Taken straight from publisher manifests. Some of these handle the format for a narrow purpose rather than as their main job.

Common questions

How do I open an HTML file in a browser?
Double-click it, or drag the file onto an open browser window. You can also use File, Open File from the browser menu and pick the file from disk.
Why does my saved web page have no images or formatting?
The page saved its assets into a separate folder named after the file with an "_files" suffix. Without that folder next to the .html, only the bare text loads. Keep both together or save as a single-file archive instead.

Related formats