File Formats
What Is HTML? History, Parsing and the DOM
HTML is the markup language that describes the structure of web pages, and it sits underneath nearly every website. We cover its history, how browsers process it and what to watch for when turning HTML into documents.
Author: Hemen Dönüştür Editör EkibiPublished: 8 min read

Almost everything you see on the web, including this page, is written in HTML. HTML (HyperText Markup Language) is not a programming language but a markup language that describes the structure of a document: this is a heading, this is a paragraph, this is a link, this is a table. And HTML is not only for websites. It shows up in email templates, help documentation, exported reports and documents "saved as a web page". This article covers the history of HTML, how a browser reads it and draws it on screen, common problems, and what to keep in mind when converting HTML files to Word or PDF.
What is HTML?
HTML is a plain-text language that marks up content with tags. Tags are written between angle brackets, and most of them form an element with an opening and a closing tag:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample page</title>
</head>
<body>
<h1>Hello</h1>
<p>This paragraph contains a <a href="https://example.com">link</a>.</p>
</body>
</html>
The <head> section carries information about the page (character encoding, title, stylesheets), while <body> holds the visible content. Appearance is added with CSS and behavior with JavaScript. In that split, HTML describes what the content is, CSS how it looks and JavaScript what it does.
A short history
HTML was born as part of the World Wide Web project that Tim Berners-Lee proposed at CERN in 1989. His first browser ran on a NeXT computer in 1990. The earliest versions of the language were less a formal standard than a list of tags documented at CERN. The key milestones since then:
- November 1995, HTML 2.0: RFC 1866, written by Tim Berners-Lee and Dan Connolly, defined HTML as a formal standard for the first time.
- January 1997, HTML 3.2: the version W3C formally endorsed as a cross-industry specification.
- December 24, 1999, HTML 4.01: remained the web's core specification for years; W3C formally marked it as superseded on March 27, 2018.
- October 28, 2014, HTML5: W3C published HTML5 as a Recommendation. Video, audio, semantic sectioning elements and a precisely defined parsing algorithm were standardized with it.
- May 28, 2019, a single standard: W3C and WHATWG, the community formed by browser vendors, signed a memorandum of understanding. Under it, HTML and the DOM are developed principally at WHATWG as an unversioned "Living Standard".
So "HTML5" today effectively means "current HTML"; the official specification is the continuously updated HTML Living Standard.
How widespread is it? According to W3Techs statistics from October 15, 2026, 97.8% of websites whose markup language is known use HTML. The same source reports that 99.1% of websites whose character encoding is known use UTF-8.
How does a browser process HTML?
What sets HTML apart from other document formats is that even badly written documents are interpreted the same way in every browser. The HTML Living Standard defines a detailed parsing model for this:
- Determining the encoding: the browser must first turn incoming bytes into characters. It checks, in order, for a BOM, the encoding declared in the server's HTTP header and a
<meta charset>declaration in the first 1024 bytes of the document; if none is found, it makes an educated guess. - Tokenization: a state machine splits the text into tokens such as start tags, end tags, comments, DOCTYPEs and characters.
- Tree construction: tokens are processed according to insertion modes such as "in body" or "in table". The parser keeps a stack of open elements and repairs misnested tags according to defined rules.
- The DOM: the result is a tree of objects called the Document Object Model (DOM). CSS is applied to that tree, and JavaScript reads and modifies it.
The specification is explicit that the error handling for parse errors is well defined. Write <div/>, for example, and HTML ignores the trailing slash, so the following elements end up inside that div. An unclosed <p> is closed automatically when the next block element arrives. This tolerance is what keeps the web working despite countless imperfect pages, but it also means any tool that converts HTML into a document format has to follow the same rules.
Where is HTML used?
- Websites and web apps: the skeleton of every web page.
- Email: formatted emails and newsletters are written in HTML.
- Documentation: help pages, software docs and sites generated from Markdown.
- E-books: the EPUB format packages content as XHTML documents.
- Reports and exports: many applications produce reports as HTML, and Word's "Save as Web Page" output is HTML too.
Strengths and weaknesses
| Strengths | Weaknesses |
|---|---|
| Opens in a browser on any device | Appearance depends on external CSS, fonts and images |
| Open, free and continuously updated standard | Weak on print concepts such as pages and margins |
| Fluid layout that adapts to screen size | Hard to move as a single file (images live in separate files) |
| Semantic structure for accessibility and search engines | Requires care when it contains JavaScript |
| Plain text, so it works well with version control | Less suitable than PDF for freezing a final version |
Which programs open HTML?
Every browser, including Chrome, Firefox, Safari and Edge, displays HTML. To edit the source, a code editor such as Visual Studio Code or any text editor is enough. Microsoft Word and LibreOffice Writer can open HTML files and edit them as documents, although complex CSS layouts get simplified there.
Common problems and how to fix them
Special characters look garbled
The page's encoding is missing or wrong. Add <meta charset="utf-8"> near the top of the <head> and make sure the file is actually saved as UTF-8. If the server declares a different encoding, fix the HTTP header as well.
A saved page has no images or styles
HTML files often pull images and CSS from separate files or from addresses on the internet. Move only the .html file and those links break. Use your browser's "Web page, complete" save option or embed the images in the document.
The page breaks when printed
Layouts designed for screens may not fit on paper. Defining @media print rules and setting paper size and margins with @page in CSS greatly improves printed output.
Tips for converting HTML files
On our converter, HTML files are uploaded to our server and deleted within 30 minutes. When the file is read, the encoding is detected from the BOM, then the <meta charset> declaration, then the content itself; legacy Turkish pages that are not UTF-8 are read as Windows-1254. The document's <body> content and the page's <style> block are kept, and HTML fragments without a <body> tag are processed as they are.
- HTML to PDF runs in a browser engine: print CSS is applied, a page size defined with
@pageis honored (A4 otherwise), and background colors are printed. For security, JavaScript is not executed and images, fonts or stylesheets on the internet are not downloaded; only resources embedded in the document (data: URIs) are used. If you want images in the output, embed them in the HTML. - HTML to Word uses LibreOffice to carry headings, lists, tables, alignment and embedded images into DOCX. Complex CSS layouts (flex, grid) have no Word equivalent and are simplified.
- HTML to Markdown is ideal for moving a web page or help article into a documentation repository: headings, emphasis, lists, tables, links and code blocks are kept, and style information is dropped.
- In the other direction, Word to HTML embeds images inside the file and produces a single, self-contained HTML document with its character encoding declared, so accented characters display correctly in the browser.
Frequently Asked Questions
Is HTML a programming language?
No. HTML is a markup language: it describes the structure of content but has no loops, conditions or calculations. JavaScript is used to add behavior to a page.
What is the difference between HTML5 and HTML?
HTML5 is the name of the major version that became a W3C Recommendation in 2014. Since 2019, HTML has been developed at WHATWG without version numbers as the "HTML Living Standard". In practice, HTML5 and HTML mean the same thing today.
How do I open an HTML file?
Double-click it and it opens in your default browser. To see the source code, open the file in a text editor or use your browser's "View page source" option.
Why are images missing when I convert HTML to PDF?
If images are loaded from an internet address, our converter does not download them for security reasons. Embed the images in the HTML as data: URIs, or convert the document to Word first and add the images there.
Is an HTML file safe to open?
HTML can contain JavaScript, so be careful with files from unknown sources. HTML pages arriving as email attachments and asking for a password are a common phishing technique.
Sources
- WHATWG: HTML Living Standard, Parsing HTML documents
- W3C and WHATWG Memorandum of Understanding (May 28, 2019)
- W3C press release: HTML5 Recommendation (October 28, 2014)
- W3C: HTML 4.01 Specification
- IETF RFC 1866: Hypertext Markup Language - 2.0
- Dave Raggett: A history of HTML
- W3Techs: Usage statistics of markup languages for websites


