What is the Extension of HTML File?

Learn via video course
FREE
View all courses
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
Topics Covered

Introduction

.html is the extension of an HTML file. Like any other file that is on your device, HTML files also have an extension(we'll know more about it later in the article), and that is .html at the end of the HTML file name, for example, index.html

In the late 90s90s, when HTML was introduced, .htm was used as the extension of an HTML file. However, nowadays, .html is preferred and used commonly. We will discuss this in detail later in this article.

What is an HTML File?

A file that contains Hyper Text Markup Language is called an HTML file. This file is stored in a standard text format with the .html extension and contains tags that define a webpage layout and content like text, tables, images, videos, and hyperlinks.

Example

index.html

How to Open HTML Files?

We can open an HTML file through source code editors like Visual Studio Code of Microsoft, Sublime Text, Atom, etc. We can also edit an HTML file with these source code editors.

As an HTML file is saved as plain text, we can also open and edit an HTML file in a simple text editor software like Microsoft Notepad for windows or Apple TextEdit for MacOS.

To preview the result that an HTML file has generated or to say to view the webpage the HTML file has created, we can open the HTML file in a common web browser like Google Chrome , Firefox, Safari, Opera, etc.

How to Convert HTML Files to PDF, DOCX, XLS, or JPG?

There are many tools available online that allow a user to convert their HTML file into PDF, DOCX, and XLS.

If you don't want to use any online tool, then there is one more way to convert your HTML file. Open the HTML file that you want to convert with MS Word and click on the save as option. In the list of extensions that you will get when you click on save, select the extension that you want your file to convert. For PDF, select .pdf, for DOCX, select .docx, etc.

If you want to convert your HTML file to JPG, Open the HTML file in a code editor or text editor and then take a snapshot of the HTML code, and save the snapshot. Your HTML file will be successfully converted into a JPG.

Why to Use .html instead of .htm Extension?

When HTML was first introduced in 1993 by Tim Berners-Lee and other engineers of CERN, the operating systems of that time did not support more than three character extensions. So, .htm was used as the extension of an HTML file.

However, nowadays, operating systems are more advanced, and all of them support four characters extensions like .html or .jpeg.

We use .html and not .htm because the .html extension is a better representation of an HTML file as it contains the full abbreviation of the Hyper Text Markup Language and not the .htm extension that was used previously.

Learn More

Learn more about HTML and its tags:

Conclusion

Let's do a recap of what we learned in what is the extension of HTML file:

  • .html is the extension of the HTML file.
  • The HTML file contains Hyper Text Markup Language that defines the layout of a webpage.
  • We can open an HTML file in a source code editor or a text editor.
  • To preview an HTML file, we open it in a web browser.
  • We use .html instead of .htm as an extension because it is a better representation of an HTML file.