TROUBLESHOOTING

How to open an HTML file in Chrome (Windows, Mac and Chromebook)

You have an .html file on your computer and want to see it as a page in Chrome. The quick ways on each system, what to do when it shows code or breaks, and how to send it to someone else.

4 min read·

Chrome opens .html files saved on your computer. It does not always do so by default: double-clicking the file can open a text editor, another browser or a code editor instead. Here are the ways to get the file into Chrome, then the fixes for the most common problems.

Three ways to open the file in Chrome

The address bar then starts with file:/// followed by the path on your disk. That address only works on your own computer.

  • ✓Drag and drop: open a Chrome window and drag the .html file from your desktop or file manager onto it. Works on Windows, Mac and Chromebook.
  • ✓Open with: on Windows, right-click the file, choose Open with, then Google Chrome. On a Mac, right-click (or Control-click), choose Open With, then Google Chrome. On a Chromebook, double-click the file in the Files app, or right-click and choose Open with Chrome.
  • ✓Keyboard: in Chrome on Windows or Chromebook press Ctrl+O, on a Mac press Cmd+O, then pick the file.

Make Chrome open .html files by default

Set this once and double-clicking any .html file opens it in Chrome.

  • ✓Windows 11: Settings, Apps, Default apps, search for .html and choose Google Chrome. Or right-click the file, Open with, Choose another app, pick Chrome and tick Always.
  • ✓Mac: select the file in Finder, press Cmd+I, set Open with to Google Chrome and click Change All.
  • ✓Chromebook: right-click the file, Open with, Change default, then Chrome.

If Chrome shows code instead of the page

Chrome renders a file as a page only when it is saved as .html and contains plain HTML. Three things usually break that.

  • ✓Check the real file name. Windows hides extensions by default, so a file can be named page.html.txt and open as text. Turn on File name extensions in File Explorer (View, Show) and rename it to end in .html.
  • ✓Check the address bar. A view-source: prefix shows the code on purpose; remove it and reload.
  • ✓Open the file and look at the top. If it starts with a code fence such as ```html or a line of chat text, it was copied from an AI chat with extra text around it. Delete everything before <!DOCTYPE html> and after </html>, save, and open it again.

If the page opens but parts are missing

A page opened from file:/// runs under stricter rules than one opened from a web address. Chrome blocks a page on disk from loading a local JSON or CSV file with fetch, and blocks scripts marked type="module", so charts stay empty and buttons do nothing. Images, CSS and scripts referenced by a relative path also have to sit in the right folder next to the .html file.

Press F12 (Cmd+Option+J on a Mac) and look at the Console tab. A message about "CORS" or "file://" means the page needs to be served from a web address. You can run a local server, or put the data inside the file: see making an HTML file self-contained and loading a JSON file in a shared page.

Sending the page to someone else

A file:/// address points at your disk, so pasting it to a colleague does nothing. Emailing the .html file works only if they save it and open it the same way, and phones handle it badly (see opening an HTML file on iPhone and on Android).

With FileShare Pro you upload the .html file and get an https:// link that opens in Chrome or any other browser. Because the page is served from a web address, module scripts run, and data files can be uploaded to Media and fetched from there (see the JSON guide above).

If an AI tool made the file

Pages from Claude, ChatGPT or Gemini are usually a single .html file once downloaded. See downloading a Claude artifact and sharing a ChatGPT canvas, then open the file in Chrome as above to check it before you send it. Sign up free to turn it into a link.

Frequently asked

Why does my HTML file open in Notepad or TextEdit instead of Chrome?

The system default app for .html is set to a text editor. Use Open with to pick Chrome once, or change the default as described above.

Why does the page work on my computer but not for the person I sent it to?

The page probably loads images or data from files next to it on your disk. Only the .html file was sent. Bundle those files into the page, or host them online, and send a link.

Can I open an HTML file in Chrome on my phone?

Not reliably from storage. Phones often show the file as code or a preview. Open it from an https:// link instead.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free