What’s the difference between .htm and .html? I’ve come across both these on the web. And can you advise on which one I should use?
Both .htm and .html are file extensions for HTML (HyperText Markup Language) files. So, to frame the question correctly for the benefit of all, what is the difference between these two file extensions?
However, before I get to the answer, here are some quick points:
There is absolutely no difference between .html and .htm files. They can be used interchangeably. Thus, you can rename a .html file to .htm and vice versa and the browser program will display it the same way.
The only difference is the file extension.
So why have two file extensions for the same kind of file? That, my friend, is because once upon a time, on many operating systems, file extensions could only be of three characters. This was especially true for Microsoft Windows, the most popular OS.
Thus, a lot of web pages created in “the good old days” (just a decade back or so) will have .htm file extension. And, I suppose, many old-schoolers would still be using .htm instead of .html.
Personally, I stopped using the three letter file extensions long time back and suggest you do the same. .htm seems a bit ancient in my opinion.
Finally, here is another bit of information. Files with .html or .htm extension may contain server-side code too. Thus, one can put PHP code and have it run with these files extensions. This is done by changing the server settings so that the files are parsed through the PHP interpreter. The web browser, however, will never show server-side code and present only HTML to the viewer.
"I Am Rich" which displayed a simple misspelled message was a completely useless app on the Apple App Store. It was developed by Armin Heinrich of Germany and was priced at $999.99. Though Apple removed it the very next day, it had already been purchased eight times... and only once accidentally! We have a detailed post on this $999.99 useless app - check it out to know more. [more...]