Skip to main content

Command Palette

Search for a command to run...

How a Browser Works

Published
3 min read

We use a browser every day.
Chrome, Edge, Firefox — we open them and websites appear.

But have you ever stopped and asked:

What actually happens after I type a URL and press Enter?

A browser does much more than “open websites”.
It works like a team of components, each with a clear responsibility.

Let’s walk through this journey step by step.

What a Browser Really Is A browser is a software application that:

  • Talks to servers

  • Downloads web files

  • Understands HTML, CSS, and JavaScript

  • Converts code into pixels on your screen

You can think of a browser as a translator + painter combined into one

Main Parts of Browser (High-Level)

At a high level, a browser has these main parts:

  • User Interface

  • Browser Engine

  • Rendering Engine

  • Networking

  • JavaScript Engine

  • Data Storage

You don’t need to memorize these now — just understand that each part has one job.

User Interface (UI)

This is the part you interact with directly:

  • Address bar

  • Back / forward buttons

  • Tabs

  • Bookmarks

The UI does not render the page.
It only helps you control the browser.

Think of it like the steering wheel of a car.

Browser Engine vs Rendering Engine

This part confuses many beginners, so let’s keep it simple.

Browser Engine

  • Acts as a middle manager

  • Connects UI with the rendering engine

  • Tells the rendering engine what to load

Rendering Engine

  • Converts HTML and CSS into visible content

  • Builds structures like DOM and CSSOM

  • Handles layout and painting

Examples (just names, no deep dive):

  • Chromium (Blink)

  • Firefox (Gecko)

Networking: How Files Are Fetched

When you press Enter:

  1. Browser sends a network request

  2. Server responds with HTML, CSS, JS, images

  3. Browser receives these files

This is handled by the networking layer.

You don’t see this happening, but it’s the first real step.

HTML Parsing and DOM Creation

Once HTML is downloaded, the browser starts parsing it.

Parsing means:

Reading something and breaking it into meaningful pieces

The browser converts HTML into a DOM (Document Object Model).

Think of DOM as a tree structure:

  • HTML elements are nodes

  • Parent–child relationships exist

    CSS Parsing and CSSOM Creation

    CSS is also parsed, but separately.

    The browser creates:
    👉 CSSOM (CSS Object Model)

    CSSOM describes:

    • Colors

    • Fonts

    • Sizes

    • Layout rules

Just like DOM, CSSOM is also a tree.

  • DOM + CSSOM = Render Tree

    DOM shows what elements exist
    CSSOM shows how they should look

    The browser combines both to create the Render Tree.

    Important:

    • Only visible elements are included

    • Hidden elements are ignored

Layout (Reflow), Painting, and Display

Now the browser knows:

  • What to show

  • How to style it

Next steps:

Layout (Reflow)

  • Calculates exact size and position

Painting

  • Fills colors, text, borders, images

Display

  • Final pixels appear on your screen

Very Simple Parsing Example

Let’s understand parsing with a simple example.

Expression

The browser doesn’t read it left to right blindly.
It creates a tree to understand meaning.

This is similar to how HTML is parsed into DOM.