Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

An .html file is a plaintext document containing HTML markup that a web browser can render as a webpage. The extension is part of the filename; HTML itself is the language that describes the page’s structure and meaning. The related .htm extension is also commonly used.

What is an HTML file?

HTML stands for HyperText Markup Language. It organizes webpage content into elements that describe what that content is—for example, a heading, paragraph, link, or image. MDN describes an HTML document as a plaintext document structured with elements. See MDN’s HTML glossary and its HTML guide.

Elements are represented with tags. Many elements have an opening tag and a closing tag, while some, such as <img>, are void elements and do not have a closing tag. Attributes can add information to an element, such as the destination of a link or the source of an image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What does the .html extension mean?

The suffix .html is a filename convention that signals the file contains an HTML document. .htm is another common extension for the same kind of document. The suffix is not the HTML markup, and changing a filename’s extension does not by itself convert the file’s contents into HTML. The WHATWG HTML Standard describes filename extensions as conventions platforms use to identify file types and influence how files are opened.

#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

How are the extension, <html> tag, and doctype different?

They operate at different levels: the extension is in the filename, the doctype is a declaration at the start of the document, and the <html> element is the root element that contains the document’s HTML content. Using a file named page.html and including <!doctype html> does not replace the root element; each serves a separate purpose.

The root element can also carry a valid lang attribute, such as <html lang="en">. This helps screen-reading technology determine the page’s language and pronounce it appropriately. MDN explains the HTML root element.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How does an HTML file become a webpage?

A browser can open an HTML document and render its elements as a page. CSS is commonly used alongside HTML to control presentation, while JavaScript can add behavior. These technologies complement HTML; they are not what the .html extension means.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a server sends an HTML document over the web, the recommended media type is text/html. That media type is information sent with the response, not the filename suffix. A file ending in .html does not, on its own, guarantee how a server labels the content or how a browser interprets it. The W3C reference on HTML MIME type identifies text/html as the recommended type.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.