differences between html and htm

Posted on 2004-11-14
Last Modified: 2010-04-06
This is probably a really dumb question but what is the difference between htm and html code extensions?

I seem to have both and it is causing broken links.

thanks in advance,

Question by:dprice7
    LVL 13

    Expert Comment

    They're the same.
    htm was created when 8.3 filenames (8 character filename, 3 character extension) were still very common, html had 4 letters and needed to be shortened. Now it's just a matter of preference.
    LVL 4

    Expert Comment

    The reason it can be either is this:
    Windows used to only allow 4 character extensions, while a few others allowed 4 character extensions to make it easier for the user.  So on windows, it was .htm (3 char limit) and on others it was .html (to make it easy).  Now to make it not have to be a hassle to have 2 file names for every static page you create, you can now use either.
    LVL 10

    Expert Comment

    You also need to take the server into consideration.  Only for the default document though.  If a server is set to use index.html as the default it will not use index.htm unless that is also in the list of defaults.  The different suffixes make for different files.  You can have both mypage.htm and mypage.html with completely different content.  They are different files.

    Pretty much all computers these days are not limited to the old DOS style of 8.3 names so it really does just leave it to preference.  With that said, even if a computer does have that limit it will still show 8.4 named web pages because that is up to the server hosting the page and not the computer browsing it.
    LVL 18

    Expert Comment

    cachedVB meant to say "used to only allow 3 character"

    But the other posters have it basically correct.  On a modern computer, there is no difference.  Historically, in certain operating systems could only have file names with 8 letters and 3 more in the extension, or "8.3"  Here's a good article about that:  It goes into a lot of the weird things that happened when Microsoft worked around that limitation.
    LVL 6

    Expert Comment

    One thing to account for is that the XHTML spec has .html as the standard extension name.  so if you are interested in being standards compliant, use html.

    if you don't care, then use htm.   But I would recommend using .html as it's good practice to get into a standards habit. No one ever fired somebody for using IBM... er  html.

    Author Comment


    thanks for the overwelming response from everybody!

    I guess I should  have phrased my question a little differently.

    What I was actually trying to understand was how I ended up with two sets of filenames when I was creating my site?

    Didn't know if maybe Dreamweaver was creating with different extensions or what made the htm vs html files.

    I wonder if they will let me give everybody 50 points on this one?

    thanks ,
    LVL 10

    Expert Comment

    To give everyone above 50 points you will have to increase yours points to 250 then select split points and then you can give each 50 :)


    LVL 4

    Expert Comment

    You probably won't want to increase to 250 though, thats 200 more points.  I recommend just picking 1 and give that person 50, or 2 and give each 25.
    LVL 14

    Assisted Solution

    In my case Dreamweaver always creates .htm documents, and not .html files. I guess you yourself have saved some files with .html extension.
    Something far: in default IIS settings, the home page should have one of these names: index.htm, Default.asp, or Default.htm
    so I prefer to work with .htm!
    PS:Seems that all people hear are hungry for points! ;o) If it helps, you can ignore me and give them the points, as you would before I posted here. (I'm joking, but don't really bother if you really do so. I just meant to comment out.)

    Accepted Solution

    What is the difference between the HTM and HTML extensions?
    Short Answer
    Other then the obvious, the letter "L," there's not much of a difference between the two extensions. Most, if not all, web browsers and servers will treat a file with an HTM extension exactly as it would a file with an HTML extension, and vice versa.

    Long Answer
    Practical Differences
    Practically speaking, there is no difference between the two extensions. Both denote that the file contains HTML. This is really a matter of convention and is not an absolute, but most realize that a file whose extension is htm or html contains HTML.

    On most, if not all, servers either file will be sent with a MIME type of text/html by default. This can usually be changed by the server's administrator(s), but is, more often then not, left alone.

    On most, if not all, browsers, either file will be displayed as intended (i.e. rendered according to the browser's default manner of displaying HTML documents). This last is due more to the MIME type sent by the server then by the file's extension, but that's a matter for another FAQ.

    Generally, the use of htm over html, or vice versa, is left to the author's personal preferences.

    Technical Differences
    Technically speaking there are few to no important differences. An obvious difference is the addition of the letter "L" in the html extension. The technical difference that the additional letter will make to the operating system is better left to a different discussion but in the context of a web author, the additional "L" will make no difference.

    The technical difference that the additional letter will make to an http server (a "web server") is minimal. Usually, a server will use a file's extension to figure out what MIME type to send back to the requesting client. Most servers are configured by default to send back the text/html type when the requested file ends in an htm or html extension. This can be changed by the server's administrator(s) in such a way that one of the above extensions returns a different MIME type then the other, however, this is not a very common practice.

    It is a common misconception that a file ending in an htm extension had to have been created on a DOS/Windows 3.x platform. This is because those operating environments limit filenames to a 3 letter extension. However, it is very simple to create a file with a 3 letter extension on most other platforms, as well. Even those that allow longer file extensions.

    Default Filenames
    The one situation in which there may be a difference between the two extensions is that of a server's default filenames. When a URL that does not specify a filename is requested from a server, such as http://www.domain.dom/dirname/, the server returns a file from the requested URL that matches a default filename. Examples of common default filenames include "index.html," "index.htm," "welcome.html," "welcome.htm," "default.html," "default.htm," etc. However, an administrator can make the server's default filename anything he/she so desires.

    In the case of a default file, the author's filename must be exactly the same as the server's default filename. In other words, if your server is configured to use "index.html" as the default filename, your file must be named "index.html" and not "index.htm."

    Note that servers are often configured with more then one default filename. Check with your server administrator or ISP for details about your specific server.

    LVL 14

    Expert Comment

    king_villy has provided you with a long detailed explanation of what we said above. I think the question is answered. Aren't you going to close this quesiton by selecting one or more answers?
    Wish I can help


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now