What Is the Difference Between HTM and HTML?

The letters HTML in 3d

Quick question for web designers: what is the difference between HTM and HTML? If your answer is "nothing but an L", you may be in for a surprise.

Unix vs. Microsoft

As web server technology developed in the 1990's, two dominant programs were used: Microsoft's IIS and Unix's Apache. Both are still widely used, but back in the day there was one limitation to Microsoft, based around its reliance on the DOS platform: you could only use three letters for the file types. While Unix could fully identify the files as "HyperText Markup Language" (.HTML) the DOS based servers were limited to .HTM.

This doesn't mean that every .HTM file was created in a DOS system. Unix users were free to use three letter filetypes as well, and many chose to use .HTM as a standard simply because it was one less letter to type. The only problem came when people chose to use both on their servers, and that's where the real difference becomes apparent.

The Issue of Primacy

On most websites, the "index page" is the first page of a site that the viewer is served when they type in the domain name. When someone goes to the browser and types in "http://www.YourAmazingSite.com", for example, their computer is asking the server to give them the index page for YourAmazingSite (note: that is a fictional site, used for example purposes only).

The server will then follow the protocol that has been set for it by delivering whatever file is labeled "index" followed by whatever filetype has been designated "primary" for that server. On Microsoft servers, the default is .HTM, for example, so the server would deliver "index.htm" to the eager viewer. If there was not an "index.htm" file, it would deliver "index.html", or "index.asp", as it went down a list of filetypes.

Usually, that file would show up on the browser URL field as "http://www.YourAmazingSite.com/index.htm" and the viewer would see whatever the web designer had set up for them. Hopefully they are so fascinated by the content that they bookmark it, or even send the link to their friends or "tweet" about it.

However, if the web designer then goes back to make some changes to the site, they may save the revised index page as "index.html". Why would they do this? Perhaps they simply forgot that it was supposed to be .HTM, but more likely they've been using a new design program such as Dreamweaver which may default to saving pages with the .HTML extension. If they upload that new page and don't delete the .HTM index page, the server will continue to show index.htm as the main page of the site.

Don't Break the Site

Even worse, if they do delete the .HTM page they have also broken the link to the bookmark that the original user had. Remember that the original viewer had bookmarked http://www.YourAmazingSite.com/index.htm, and if that page doesn't exist, they will simply get a 404 error of "page not found."

Savvy users know to try deleting the "index.htm" from the URL and let the server provide whatever page is designated as the "home" page, but it's never a good idea to rely on the intelligence of your viewers. Keeping it simple and being aware of what index pages are designed to be primary on your site is always a good idea. Wordpress sites, for example, use index.php as their home pages, but you can circumvent that by including an index.htm (or html) page and then setting the server to use that instead.

What is the Difference Between HTM and HTML for You?

Practically speaking, any page of hypertext markup can be saved as either .HTM or .HTML with no difficulty. Browsers will interpret the code just as easily regardless of the file extension. The file types themselves have no real difference. At the same time, if you are involved in the back-end of a website or managing a server, it is a good idea to be aware of the vast difference the letter L can make in how your site shows up in the end.

What Is the Difference Between HTM and HTML?