HTM files are just web pages saved to your computer

An HTM file is a web page stored as a single file instead of living on a server. HTM and HTML are the same thing — both are plain text files that contain the code a browser reads to display a page. You open an HTM file the same way you open any other file: by double-clicking it, or by right-clicking and choosing which program to use.

The reason HTM exists alongside HTML is historical. Older Windows systems limited file extensions to three letters, so HTM was used instead of HTML. Today both work identically. Your browser does not care which extension the file has.

Key Takeaways

  • Double-clicking an HTM file will open it in your default browser, which is usually the fastest way to view it.
  • If double-clicking does not work, right-click the file, select "Open with", and choose your browser from the list.
  • HTM files can also be opened in a text editor like Notepad if you want to read or edit the underlying code.
  • HTM files sometimes contain links to images or other files stored in the same folder, so moving the HTM file alone may break those links.

Double-click the HTM file to open it in your browser

The simplest method is to find the HTM file on your computer and double-click it. Your operating system will open it in whatever browser you have set as your default — usually Chrome, Firefox, Safari, or Edge. The page will display exactly as it would if you visited it on the web.

If double-clicking does nothing, or opens the file in a text editor instead of a browser, move to the next section. This usually means your system does not have a default browser set, or the file association got changed.

Right-click and choose "Open with" if double-clicking does not work

Right-click the HTM file and look for an option called "Open with" (on Windows) or "Open With" (on Mac). A menu will appear showing the programs installed on your computer. Select your browser — Chrome, Firefox, Safari, Edge, or whatever you use. The file will open in that browser.

On Windows, if you do not see your browser in the list, click "Choose another app" or "More apps" at the bottom. Scroll down to find your browser and click it. On Mac, if your browser is not listed, click "Other" and navigate to your Applications folder, then select the browser you want.

If you want that browser to open all HTM files by default from now on, look for a checkbox that says "Always use this app" or "Always open with" before you click Open. This saves you from right-clicking every time.

Open the HTM file in a text editor to view or edit the code

If you want to see the actual HTML code inside the file, right-click it and choose "Open with Notepad" (Windows) or "Open with TextEdit" (Mac). The file will display as plain text showing all the HTML tags, links, and formatting code.

You can edit the code in Notepad or any text editor, save the file, and then open it in your browser again to see the changes. This is useful if you want to fix a broken link, change text, or adjust formatting. Just remember to save the file with the .htm or .html extension so your browser recognizes it.

HTM files with images or linked files may not display correctly if moved

An HTM file is often just one piece of a larger set of files. If the page includes images, stylesheets, or links to other files, those are usually stored in separate files in the same folder. When you open the HTM file, the browser looks for those other files in the same location.

If you move the HTM file to a different folder without moving the other files with it, the images will not load and links may break. To keep everything working, move the entire folder, not just the HTM file. If you are not sure what other files belong together, right-click the HTM file, select Properties (Windows) or Get Info (Mac), and look at what folder it is in — that folder likely contains all the related files.

Drag and drop an HTM file into your browser window

Another quick way to open an HTM file is to drag it directly into an open browser window. Click and hold the HTM file, drag it over the browser, and release. The page will load in that browser tab.

This method works on Windows, Mac, and Linux. It is useful if you already have your browser open and want to view the file without navigating through menus.

Set a browser as your default program for HTM files

On Windows, right-click an HTM file and select "Open with" → "Choose another app". Find your preferred browser in the list, check the box for "Always use this app to open .htm files", and click Open. From then on, double-clicking any HTM file will open it in that browser.

On Mac, right-click an HTM file and select "Open With" → your browser. Then go to System Preferences → General and look for "Default web browser" — select your browser from the dropdown. Mac will then use that browser for all HTM and HTML files.

Frequently Asked Questions

What is the difference between HTM and HTML files?

There is no functional difference. HTM is a three-letter extension used on older Windows systems, while HTML is the standard four-letter extension. Both contain the same code and open in the same way. Your browser treats them identically.

Can I edit an HTM file and save it?

Yes. Open it in a text editor like Notepad, make your changes to the code, and save the file. Make sure you save it with the .htm or .html extension so your browser recognizes it. Then open it in your browser to see the changes.

Why do images not show up when I open an HTM file?

The HTM file probably contains links to image files stored in a separate folder. When you move or copy just the HTM file, those image links break. Move the entire folder containing the HTM file and all related files together to keep everything working.

Can I open an HTM file on my phone?

Yes, but the process depends on your phone. On iPhone, use the Files app to locate the HTM file, then tap it and select your browser. On Android, use a file manager app, find the HTM file, and tap it to open it in your default browser.

What if my browser is not in the "Open with" list?

On Windows, click "Choose another app" or "More apps" and scroll down — your browser may be listed further down. If it is not there, your browser may not be installed. Install Chrome, Firefox, or Edge from their official websites, then try again.