How a Web Browser Works
From a program on one NeXT computer at CERN to the most complicated thing on your computer: a short history of browsers, what happens between the HTML and the pixels, why nearly 80% of the web is seen through Google's Blink engine, what a browser has to know today, and how the Ladybird project is building a new one from scratch anyway.
Open in the interactive Digital Garden
| What You Need |
|---|
| Any browser and its developer tools (F12) – that's enough for most examples |
| Ideally a second browser with a different engine, for example Firefox next to Chrome or Edge |
| For Example 4: a Linux or macOS computer with some patience to build Ladybird from source |
| Background: what happens before the page arrives (DNS, TLS, HTTP) is in Constructing a Website, the encryption part in How Encryption Works |
The browser is the program I open most often and think about least. I type something, a page appears. But behind that window there is a program that downloads code from strangers, runs it safely, draws text in every language of the world, plays video, makes video calls and keeps all of that separated so one bad tab can't read another. It is probably the most complicated program on my computer – and almost all of them today are built on the same engine, made mostly by one company. This note is about how we got here, how a browser works inside, and the small team that thinks it can still build a new one.
A Bit of Browser History
The first browser was written by Tim Berners-Lee at CERN in 1990, on a NeXT computer. It was called WorldWideWeb (later renamed Nexus), and it could already edit pages, not only show them. Because almost nobody had a NeXT, a math student working as an intern at CERN, Nicola Pellow, wrote the Line Mode Browser in 1991 – text only, but it ran on any old terminal.
The web exploded with Mosaic from NCSA in 1993, the first popular browser that showed pictures inside the text instead of in a separate window. Marc Andreessen, who led the team, then co-founded Netscape, and Netscape Navigator appeared as a beta in October 1994 (version 1.0 followed in December). Netscape gave us a lot of what we still use: cookies, SSL (the ancestor of today's HTTPS) and JavaScript – the first version of which Brendan Eich wrote in about ten days in May 1995.
Microsoft answered with Internet Explorer in August 1995, built on code it licensed from Spyglass, and later shipped it with every copy of Windows. That was the first "browser war", and Microsoft won it so thoroughly that IE was used by more than 90% of people in the early 2000s – and then barely changed for years. The US antitrust case against Microsoft started in 1998, partly about exactly this bundling.
Netscape, losing, did something unusual: in 1998 it released its source code, and the Mozilla project grew out of it. Its slim browser, Firefox 1.0, came out on 9 November 2004 and slowly took users away from IE. Meanwhile Apple took KHTML, the engine of the KDE desktop on Linux, made WebKit out of it for Safari (2003), and opened its source in 2005.
On 2 September 2008 Google released Chrome, together with its open-source base, Chromium. It used WebKit to draw pages, but added two big ideas: a very fast JavaScript engine (V8) and a browser split into several processes, so a crashed page no longer took the whole browser down. Five years later, on 3 April 2013, Google forked WebKit into its own engine, Blink, and said it could delete more than 7,000 files with over 4.5 million lines it didn't need right away. A few weeks earlier Opera had given up its own engine, Presto, and moved to Chromium.
The last big change came from Microsoft itself. Its own new engine, EdgeHTML, didn't catch on, and on 15 January 2020 it released a new Edge built on Chromium. Internet Explorer was officially retired on 15 June 2022. The company that won the first browser war now ships Google's engine.
How Things Look Today: Three Engines Left
The word "browser" hides two things: the engine, which turns HTML, CSS and JavaScript into a page, and the shell around it – tabs, bookmarks, settings, sync. Making a shell is a lot of work. Making an engine is enormous. That's why there are dozens of browsers, but only three engines that matter:
| Engine | Made mainly by | JavaScript engine | Browsers |
|---|---|---|---|
| Blink (Chromium) | Google, with Microsoft, Igalia, Intel, Samsung, Opera, Vivaldi, Brave and others | V8 | Chrome, Edge, Opera, Brave, Vivaldi, Samsung Internet, Arc, and the AI browsers (more below) |
| WebKit | Apple | JavaScriptCore | Safari – and on the iPhone, every browser |
| Gecko | Mozilla | SpiderMonkey | Firefox, Tor Browser, LibreWolf and other Firefox relatives |
According to StatCounter, in October 2026 Chrome had 68.8% of all page views worldwide (computers and phones together), Safari 16.6%, Edge 5.4%, Firefox 2.6%, Opera 2.2% and Samsung Internet 2.1%. Add up the Blink browsers and you get about 78% – and Brave, Vivaldi and others are usually counted as Chrome anyway. Safari is big mostly because of the iPhone. Firefox, the browser that broke IE's monopoly, is down to under 3%.
The iPhone is a special case. Apple's rules have always said that every browser on iOS must use WebKit, so Chrome or Firefox on an iPhone is really Safari's engine with a different interface. Because of the EU's Digital Markets Act, Apple has allowed other engines in the EU since iOS 17.4 (March 2024). In practice, as of September 2026, no browser has shipped one. Google and Mozilla have prototypes, and Mozilla complained early on that Apple's rules would force it to build and maintain two separate browsers. Microsoft's Kyle Pflug measured a Blink-based Edge prototype on an iPhone at 28.6% higher than Safari in the Speedometer 3.1 benchmark – his own preliminary numbers from one device, not an independent test.
Who pays for it. Browsers are free, so the money comes from somewhere else – mostly from search. Google pays to be the default search engine in Safari and in Firefox. Mozilla's audited accounts for 2024 show 498 million dollars of royalties out of 680 million in total, and say that about 86% of its revenue from contracts came from one customer – widely reported to be Google. In the US antitrust case against Google, Judge Mehta decided in September 2025 that Google doesn't have to sell Chrome and may keep paying for default placement, but not in exclusive deals; he explicitly mentioned that cutting these payments could be "crippling" for Mozilla. So the main competitor of Chrome lives largely on Google's money. That is a strange situation.
Why one engine is a problem, even a good one. Blink is a very good engine and it's open source. But when almost everybody uses it, Google's team in practice decides what the web is. If Chrome doesn't implement something, it is dead, whatever the standard says. If Chrome does, sites start to use it and the other browsers have to follow – or be "the browser where things break". Web developers test in Chrome and stop testing elsewhere, and Chrome's bugs slowly become the real standard. We've seen this film before, with Internet Explorer 6. The difference is that this time the engine is open and updated every four weeks – but a monoculture is a monoculture: one serious security bug in Blink hits most people on Earth at once.
There is some counterweight. The browser makers (Apple, Google, Igalia, Microsoft and Mozilla) run a yearly project called Interop, where they pick features that work differently in different engines and fix them together, measured with the shared Web Platform Tests. It works: things like WebGPU are now in all three engines (at least on some systems) rather than only in Chrome.
How a Browser Turns Code into a Page
Once the HTML has arrived (that part is in Constructing a Website), the engine goes through roughly the same steps every time:
- Parse HTML → DOM. The text is turned into a tree of objects: this
<body>contains this<div>, which contains this paragraph. The HTML standard describes exactly how to handle broken HTML too, so all browsers repair the same mistakes the same way. - Parse CSS → styles. For every element the browser works out which of possibly thousands of CSS rules apply and what the final colour, font and size are.
- Layout. Now it calculates where everything goes: how wide this box is, where the line breaks, how tall the page is. Text alone is hard – fonts, right-to-left scripts, emoji, hyphenation.
- Paint. The boxes become drawing commands: fill this rectangle, draw this text, this shadow.
- Composite. The page is split into layers that the graphics card puts together, so scrolling and animations stay smooth without redrawing everything.
- JavaScript runs in between and can change the DOM or styles at any time – and then parts of the work above start again. Modern JavaScript engines first interpret the code and then compile the hot parts to machine code while the page runs (a JIT compiler, see From Source Code to Silicon).
Many programs, not one. Open the Task Manager while Chrome or Firefox runs and you'll see many processes. Modern browsers split the work: one process for the browser window, one for the network, one for the graphics card, and many for web pages. The page processes run in a sandbox – they are not allowed to read your files or talk to the system directly, only to ask the main process. Since the Spectre processor bugs of 2018, Chrome even puts different sites into different processes (Site Isolation, on by default since Chrome 67), so that a bad ad on one page can't read the memory of your bank in another tab. Google measured the price at about 10–13% more memory. That's one reason browsers use so much RAM – it's partly the cost of safety.
What a Browser Has to Know Today
In 1993 a browser had to show text, links and pictures. Here is a short and incomplete list of what a browser has to do in 2026 to open the sites people actually use:
| Area | What it means |
|---|---|
| Documents | HTML, CSS with grid and flexbox, animations, hundreds of fonts and every writing system in Unicode, right-to-left text, SVG, MathML, printing, a built-in PDF viewer |
| Programs | JavaScript with a JIT compiler, WebAssembly (C, C++ or Rust code compiled for the browser), workers running in the background, offline apps with service workers |
| Graphics | Canvas, WebGL and now WebGPU – games, 3D models and even AI models running on your graphics card |
| Media | video and audio in several codecs, live streaming, video calls (WebRTC), camera, microphone, screen sharing – and DRM for Netflix and similar (Chrome gets it from Google's Widevine module, which plain Chromium doesn't have) |
| Network | HTTP/1.1, HTTP/2 and HTTP/3, TLS and checking certificates, WebSockets, DNS over HTTPS, a cache |
| Storage | cookies, local storage, a small database in every browser (IndexedDB), quotas, and wiping all of it per site |
| Security | sandbox, site isolation, permissions for location, camera and notifications, warnings for dangerous sites and downloads, a password manager, passkeys |
| Privacy | blocking trackers, separate cookie jars per site, private windows (see How Safe Is Your Phone?) |
| Accessibility | a second tree next to the DOM that screen readers and other assistive tools read, zoom, keyboard navigation |
| Everything around it | extensions, developer tools, sync between devices, translation, updates – and since 2025 more and more AI built in |
And it all has to stay compatible with pages written in 1996, because nobody wants a browser that can't open old pages. Nothing is ever really removed.
How big is that? In 2020 Drew DeVault counted 1,217 W3C specifications with about 114 million words – more than the C and C++ standards, POSIX, USB, UEFI, all 8,754 RFCs and the longest novels on Wikipedia's list put together. It was a rough count (older and replaced versions included), but the point stands. His conclusion was that it is "impossible to build a new web browser". The Chromium source today has more than 39 million lines of code, and about 2,700 people contributed to it in the twelve months to July 2026 according to Open Hub. Chrome ships a new version every four weeks (since Chrome 94 in 2021), and so does Firefox. A new browser doesn't only have to catch up – it has to catch a moving train.
Ladybird: Building One from Scratch Anyway
And still somebody is trying. Ladybird started as the browser of SerenityOS, a hobby operating system that Andreas Kling, a former WebKit developer at Apple, began writing in 2018. Everything in SerenityOS was written from scratch, including the browser engine (LibWeb) and the JavaScript engine (LibJS). The browser became a separate project in 2022, and in June 2024 Kling stepped back from SerenityOS to work only on Ladybird.
In July 2024 the Ladybird Browser Initiative was founded as a non-profit, with a gift of one million dollars from GitHub co-founder Chris Wanstrath. The rules are interesting, because they are an answer to everything above: the money comes only from donations and sponsors (among them Cloudflare, Shopify, FUTO, 37signals and Proton VPN), there are no default-search deals, sponsors get no say in the technical plan, and the engine contains no code from Blink, WebKit or Gecko. It does use common libraries for things like images, video and encryption, as other browsers do. The code is C++, and since 2026 parts are being moved to Rust – the JavaScript parser was ported in February 2026 with the help of AI coding assistants.
Progress is measured with the same Web Platform Tests as everyone else. At the end of October 2026 the counts were:
| Browser | Passed WPT subtests (end of October 2026) |
|---|---|
| Chrome | 2,244,397 |
| Firefox | 2,189,315 |
| Ladybird | 2,184,722 |
| Safari Technology Preview | 2,172,990 |
Ladybird passed Safari on 26 October. That doesn't mean it is as good as Safari – the tests don't measure speed, stability or how real sites feel – but six years after DeVault's "impossible" it is a remarkable number. The same month it got a JIT compiler for JavaScript, and its Speedometer 3 score rose from about 5.9 to 8.6 – still far behind the big browsers, but moving. The plan is a first alpha for Linux and macOS later in 2026, a beta in 2027 and a version for everybody in 2028; Windows comes later. In June 2026 the team stopped accepting code from the public and now only takes it from its own maintainers, to keep quality and security up before the alpha.
Ladybird is not alone. Servo, an engine written in Rust that Mozilla started in 2012 and that now lives at Linux Foundation Europe, is meant mainly to be built into other programs. And there is a new wave of "AI browsers" – OpenAI's ChatGPT Atlas (October 2025) and Perplexity's Comet (July 2025) – but under the hood they are Chromium again. New shells are easy. New engines are rare.
Examples
Example 1: Which Engine Am I Using?
Press F12, open the Console tab and type:
navigator.userAgent
In Edge on Windows you get something like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36 Edg/157.0.0.0
Edge claims to be Mozilla, WebKit, KHTML, Gecko, Chrome and Safari at once. That's thirty years of history in one line: each new browser pretended to be the previous winner, because sites checked for it and otherwise sent a worse page. So the user agent is not a reliable way to tell. Better:
- Chrome, Edge, Brave, Opera, Vivaldi: type
chrome://version(Edge also acceptsedge://version) – if it works, it's Chromium. - Firefox and relatives:
about:supportshows the Gecko version. - Safari: Safari → About Safari; on an iPhone the answer is always WebKit, whatever the icon says.
Example 2: Watch the Browser Work
- Open any page and press F12.
- Elements (Firefox: Inspector) shows the DOM – not the HTML the server sent, but the tree the browser built from it, after JavaScript changed it.
- Network: reload the page and see every file, how big it is and how long it took. A news site often loads hundreds of files, many of them from advertising and tracking companies.
- Performance: press record, scroll a bit, stop. You'll see the pipeline from the picture above: scripting, style, layout, paint, in coloured blocks.
- In Chrome, open the menu with the three dots in DevTools → More tools → Rendering and turn on Paint flashing: every area the browser has to draw again flashes green.
Example 3: Do Different Engines Agree?
Go to wpt.fyi/interop-2026 and look at the scores: for each feature you see how many tests Chrome, Edge, Firefox and Safari pass, and how they caught up during the year. If you make web pages, open your own site in two engines – for example Chrome and Firefox – before you call it done. Things that only work in Chrome are exactly how a monoculture grows.
Example 4: Try Ladybird
Until the alpha is out, Ladybird has to be built from source. On Linux or macOS, first install the prerequisites from the build instructions (it needs a recent C++23 compiler, CMake, Qt on Linux, and a Rust toolchain), then:
git clone https://github.com/LadybirdBrowser/ladybird.git
cd ladybird
./Meta/ladybird.py run
The first build downloads its libraries and compiles for quite a while. Then open a few sites you use every day and see what works. It's pre-alpha software – don't use it for your bank – but it's a strange and nice feeling to see a page drawn by an engine that has nothing to do with Google, Apple or Mozilla.
Keeping It Safe
- Updates first. The browser is the program that touches the most untrusted code, and browser bugs are among the most attacked. Let it update itself and restart it when it asks.
- Few extensions. An extension that can "read and change all your data on all websites" really can. Install only what you need, from known authors, and remove what you don't use.
- The engine matters for privacy too. Firefox, Safari and Brave block many trackers by default; Chrome's business is advertising. The tracking part is explained in How Safe Is Your Phone?.
- Careful with AI agents in the browser. An assistant that reads pages and clicks for you also reads instructions hidden in those pages. Don't let it near your e-mail, bank or passwords without watching what it does.
A Few More Thoughts
What I find fascinating is that the browser has quietly become the operating system that most people actually use. Office, mail, maps, video calls, even games – all in a browser tab. Whoever makes the engine decides a lot about what the web can and can't do. Today that is mostly one company, and the main alternative is paid by the same company. That is not a conspiracy, it's simply how the money flows – but it's worth knowing.
I use four browsers myself, for different things: Chrome, Edge, Firefox and Brave. Only while writing this note did I really notice that three of them are the same engine underneath – only Firefox draws pages differently. That's the monoculture from above, on one computer.
That's also why Ladybird is interesting to me, even if it's not something for every day yet. It shows that a small team with clear rules can still do what everybody said was impossible. And for the rest of us the advice is simple: keep at least one browser with a different engine on your computer, and use it now and then. Every non-Chromium visitor is a small vote for a web that more than one company gets to shape.