Browser Engines: Blink, WebKit and Gecko
What a browser engine does, how Blink, WebKit and Gecko are related, and why the difference matters to users and site builders.
Key takeaways
- The engine parses HTML and CSS, lays out and paints the page, and works alongside a JavaScript engine that runs scripts.
- Blink began as a fork of WebKit, and WebKit itself grew from the KHTML engine created by the KDE project.
- Gecko, developed under Mozilla, has a separate lineage from the other two.
- Browsers that share an engine usually share rendering behavior and many security flaws, along with their fixes.
- Web developers get the best results by following standards and testing for features instead of guessing from the browser's name.
A browser engine is the part of a browser that turns a page's code into what you see and interact with. Three engines carry nearly all of today's web: Blink (Chrome, Edge, Opera, Brave and many others), WebKit (Safari) and Gecko (Firefox). The browser around the engine supplies tabs, sync and settings.
Knowing which engine you're using explains why some browsers behave identically, why a site can break in one and work in another, and why people who care about the open web pay attention to how many engines remain.
What an engine actually does
When a page arrives, the browser has a stream of bytes. The engine makes sense of it in stages:
- Parse HTML into a tree of objects called the DOM (Document Object Model), which represents the page's structure.
- Parse CSS and work out which style rules apply to each element.
- Lay out the page, calculating the size and position of every box and line of text.
- Paint those boxes, text and images into layers.
- Composite the layers, often with help from the graphics processor, into the picture on screen.
Scripts can change the DOM or styles at any point, which sends the engine back through some of these steps. The longer walk-through in how a browser turns code into pixels shows where the time goes.
Rendering engine and JavaScript engine
Running JavaScript is handled by a closely linked but distinct component. Chromium uses V8, Safari uses JavaScriptCore and Firefox uses SpiderMonkey. Each compiles frequently used code into machine instructions while the page runs, which is why modern web apps can feel close to installed programs.
V8 is also used outside browsers, most famously in Node.js, a runtime for server programs. The same engines run WebAssembly, a compact binary format that lets code written in languages such as C++ or Rust execute in the page. See WebAssembly in the browser for what that enables.
The family tree
The three engines have tangled histories.
WebKit started when Apple took KHTML, the engine of the KDE project's Konqueror browser, and built Safari on it. Apple announced Safari in 2003, and WebKit later became an open-source project in its own right.
Blink was created in 2013 when Google forked WebKit's rendering code for Chromium. The two have diverged considerably since, with different internal architecture and different decisions about which features to ship.
Gecko comes from the Mozilla project, which began after Netscape released its browser source code in 1998. Firefox 1.0 arrived in 2004. Gecko has been heavily rewritten over time, including components written in Rust, a language Mozilla helped bring to maturity.
Older engines have faded. Microsoft's Trident powered Internet Explorer, and its successor EdgeHTML powered the first version of Edge before Microsoft moved to Chromium. Opera had its own engine, Presto, until it switched as well. The broader story is told in the browser wars.
Which browsers use which engine
| Engine | JavaScript engine | Examples of browsers |
|---|---|---|
| Blink | V8 | Chrome, Edge, Opera, Brave, Vivaldi, Samsung Internet |
| WebKit | JavaScriptCore | Safari, GNOME Web, browsers on most iPhones |
| Gecko | SpiderMonkey | Firefox, Tor Browser and other Firefox-based browsers |
Platform rules can override a browser's usual choice. Apple has historically required every browser on iOS to use the system's WebKit, so Chrome or Firefox on most iPhones are different interfaces around the same engine. Certain jurisdictions have required Apple to allow alternatives. Rules differ by region and have been changing, so check current developer and vendor documentation.
What sits around the engine
Two browsers can share an engine and still feel unrelated, because a great deal of a browser is not the engine. The surrounding program, sometimes called the browser shell or "chrome" (the origin of the product's name, which referred to the window decorations), provides the address bar, tabs, bookmarks, history, downloads, extension support, sync and settings.
Modern browsers also split themselves into several operating system processes. A coordinating process owns the window and has access to your files and network. Separate renderer processes run the engine for web pages with very limited permissions, a design known as sandboxing. Many browsers further place different sites in different renderers, called site isolation, so that a malicious page has a harder time reading another site's data. A crashed renderer takes down a tab instead of everything, and the price is higher memory use.
Engines outside the browser window
You run browser engines more often than you think. Many apps display web content inside their own windows using an embeddable view: WebView2 on Windows is based on Edge's Chromium, WKWebView on Apple platforms uses WebKit, and Android's system WebView is Chromium-based. Frameworks such as Electron bundle Chromium and Node.js so that a desktop app can be written with web technology.
This has a maintenance consequence. A shared system view gets patched along with the operating system or its updater. A copy bundled inside an app gets patched only when that app ships a new release, so keeping your desktop apps updated matters too. Embedded views inside social and messaging apps also lack your usual extensions and saved logins, which explains why a link opened there can behave differently from the same link in your browser.
Email programs are a separate case. Many show HTML messages with a restricted or older rendering component and strip out scripts, so an email that looks right in one client can look wrong in another even though your browser would render it perfectly.
Why engine differences matter to users
If a site misbehaves, switching between two browsers on the same engine often changes nothing, unless an extension or stored data was the cause. Switching to a different engine is a better test. That's the first step in diagnosing one-browser failures.
Security works in a similar way. A flaw in Blink or V8 typically affects every Chromium-based browser until each one ships the patch. A large shared codebase gets intense scrutiny and fast fixes upstream, while also giving attackers one target with wide reach. Either way, how quickly your browser's maker passes along fixes is what protects you.
Battery life, memory behavior and the arrival of new web features also differ by engine. A feature you read about may work in one and not yet in another.
Why they matter to the web itself
The web runs on published specifications. The WHATWG maintains the HTML and DOM standards, the W3C publishes CSS and many other specifications, and a committee known as TC39 at Ecma International develops the language standard behind JavaScript, called ECMAScript.
Standards are sturdier when several independent engines implement them. Writing the same feature twice exposes vague wording and design mistakes, and no single vendor can easily redefine behavior. The argument on the other side is practical: maintaining a full engine takes an enormous, continuing effort, and shared code lets many companies build browsers they couldn't otherwise afford. The article on why browsers share Chromium weighs that trade.
New engines are rare but not impossible. Projects such as Servo, which began at Mozilla, and the independent Ladybird browser have been working on alternatives. Check their own sites to see how usable they are today.
What developers should do
Browsers identify themselves with a User-Agent string, and for historical reasons these strings are misleading. Nearly all begin with Mozilla/5.0, and Chromium browsers mention WebKit and Safari. Code that guesses abilities from this text breaks easily. You can see your own string with the request header echo tool.
Test for the feature instead. In CSS:
@supports (display: grid) {
.gallery { display: grid; }
} And in JavaScript:
if ("share" in navigator) {
// show the share button
} Build a working basic version first and add enhancements where supported, an approach known as progressive enhancement. Then test in at least one browser from each engine family, including a real phone if your visitors use phones. If you're new to the layers involved, start with what HTML, CSS and JavaScript each do.
How to check which engine you're using
The browser's About page names the product and version, and sometimes the engine. In Chromium-based browsers, typing chrome://version (or the equivalent, such as edge://version) lists the underlying version and the V8 version. Firefox shows build details at about:support. In Safari, the About window lists the Safari version along with the WebKit build number.
Common questions
Is one engine faster than the others?
Each leads on some workloads and trails on others, and the picture shifts between releases. For everyday browsing, page weight, extensions and your hardware usually matter more.
Does the same engine mean the same privacy?
No. Privacy depends heavily on what the browser adds or removes around the engine: tracker blocking, cookie rules, data collection and sync design. Two Blink browsers can behave very differently there.
Can I change the engine in my browser?
Not as a setting. The engine is built into the product. To use a different one, install a browser that's based on it, subject to your operating system's rules.