Sitemap
Thotanithya

Thotanithya

How is HTML compiled?

2 min readJul 3, 2026
Press enter or click to view image in full size

HTML is not compiled in the classic sense. Instead, a web browser parses and interprets it.

The procedure goes like this:

1. The browser downloads the HTML document.

The browser asks a web server for the HTML document when you access a webpage.

<!DOCTYPE html>

<html>

<head>

<title>My Page</title>

</head>

<body>

<h1>Hello World</h1>

</body>

</html>

2. The browser parses the HTML.

The browser verifies the validity of the tags after reading the HTML from top to bottom.

For instance:

<h1>Hello World</h1>

<p>Welcome!</p>

The browser understands:

Using <h1> as a header

<p> in paragraph form

3. The browser builds the DOM.

HTML becomes the DOM, a tree-like structure.

Document

│

Get Thotanithya’s stories in your inbox

Join Medium for free to get updates from this writer.

└── html

├── head

└── title

└─ ─ body

├── h1

└── p

JavaScript interacts with this DOM to make dynamic changes to the webpage.

4. CSS is interpreted

If HTML links CSS:

<link rel=”stylesheet” href=”style.css”>

After parsing CSS, the browser creates a CSSOM.

5. Render tree creation

The browser blends the following:

DOMAIN

CSSOM.

to construct a Render Tree that only includes the components that must be shown.

6. Layout (Reflow)

The browser computes:

element locations, margins, padding, widths, and heights

Where everything shows on the page is determined in this step.

7. Applying paint

The browser displays:

text colors, borders, images, and backgrounds onto the screen.

8. Compositing

Different sections of the page are arranged on layers by modern browsers, which also mix them well. As a result, scrolling and animations run smoothly.

Have you compiled HTML?

No. The markup language HTML isn’t a programming language. It describes page structure rather than providing directions.

--

--