How a Browser Works
What Actually Happens After You Type a URL and Press Enter?
We do this action dozens of times a day. Type a URL, press Enter, and a webpage appears. It feels instant and almost boring. But under the hood, your browser performs a surprisingly long chain of coordinated steps to turn raw data into pixels on your screen.
A browser is not just something that “opens websites”. It is a complex system made of multiple components, each responsible for a specific part of the journey—from fetching files over the internet to drawing text and images on your display.
What a Browser Really Is
At a high level, a browser is a runtime environment for the web.
Its job is to fetch resources, understand them, apply rules, execute code, and finally render visual output that humans can interact with.
Instead of being one big program that does everything, a browser is more like a team of specialists working together. Each part focuses on one responsibility and passes work to the next part in the pipeline.
Main Parts of a Browser (High Level)

Most modern browsers follow roughly the same architecture:
User Interface (UI) – what you interact with
Browser Engine – coordinates between UI and rendering
Rendering Engine – turns HTML/CSS into pixels
Networking – fetches files from servers
JavaScript Engine – runs JavaScript code
Data Storage – cookies, cache, local storage
The User Interface: Where Everything Starts
The user interface includes the address bar, tabs, back/forward buttons, refresh, and bookmarks. When you type a URL and press Enter, the UI doesn’t load the page itself. Instead, it hands the request to the browser engine and says, “Here’s what the user wants.”
Browser Engine vs Rendering Engine
This distinction often confuses beginners, so here’s a clean way to think about it.
The browser engine is the coordinator. It decides what should happen next and which component should handle it.
The rendering engine is the worker. It takes HTML and CSS and turns them into something visible.
You can think of the browser engine as a project manager and the rendering engine as the builder.
Networking: Fetching HTML, CSS, and JavaScript
Once the browser engine knows what page you want, it asks the networking layer to fetch the required resources. This usually starts with an HTTP request for the HTML file.
After the HTML is received, the browser often discovers links to other resources like CSS files, JavaScript files, images, and fonts. Each of these is fetched separately, sometimes in parallel.
HTML Parsing and DOM Creation
Once HTML arrives, the rendering engine starts parsing it.
Parsing means reading raw text and turning it into structured meaning. As the browser reads the HTML, it converts it into a tree-like structure called the DOM (Document Object Model).
Each HTML tag becomes a node in this tree. Parent-child relationships in HTML become branches in the DOM. This tree structure allows the browser to understand the logical layout of the page.
CSS Parsing and CSSOM Creation
CSS goes through a similar process. The browser parses CSS rules and builds another structure called the CSSOM (CSS Object Model).
The CSSOM represents styling rules: colors, sizes, spacing, fonts, and layout instructions. Like the DOM, it is also structured as a tree.
How DOM and CSSOM Come Together
The browser combines the DOM and CSSOM to create the Render Tree.
The render tree includes only the elements that will actually appear on the screen, along with their computed styles. Hidden elements are excluded. This tree is what the browser uses to decide what to draw.
Layout, Painting, and Display
With the render tree ready, the browser calculates layout (also called reflow). This step determines the exact size and position of each element—widths, heights, and coordinates.
Next comes painting, where pixels are filled in: text is drawn, colors are applied, borders appear, and images are rendered.