Gecko
By Mozilla
Gecko is the browser engine developed by Mozilla that parses HTML, CSS, and related web standards into the rendered pages users see in Firefox and a handful of related applications. It handles layout computation, the DOM, CSS styling, and…
Definition
Gecko is the browser engine developed by Mozilla that parses HTML, CSS, and related web standards into the rendered pages users see in Firefox and a handful of related applications. It handles layout computation, the DOM, CSS styling, and hands off script execution to Mozilla's SpiderMonkey JavaScript engine, together forming the core of a standards-based web browser rather than a single visible feature.
Overview
A browser engine is the software layer that turns a document written in HTML and CSS into pixels on screen, and Gecko is Mozilla's implementation of that layer. It takes raw markup and stylesheets, builds a DOM tree and a corresponding style tree, computes layout boxes, and paints the result, while coordinating with a separate JavaScript engine to run page scripts and update that output dynamically. Firefox is the primary consumer of Gecko, but the engine has also powered Thunderbird's message rendering and various embedding projects over the years. Mechanically, Gecko's rendering pipeline resembles other engines in broad strokes but has its own internal architecture for style resolution and layout, including a project-driven rewrite of its style system in Rust known as Stylo, which parallelizes CSS computation across cores. Its layout code handles the full range of CSS layout modes, including flexbox and grid, and its platform layer abstracts operating-system differences so the same rendering logic runs across Windows, macOS, and Linux. Networking, security sandboxing, and multi-process architecture are handled by surrounding Firefox platform code that Gecko integrates with rather than owns outright. Among browser engines, Gecko is one of the few independent lineages still actively maintained, standing apart from the Chromium-derived Blink engine used by Chrome, Edge, Opera, and many other browsers, and from WebKit, which powers Safari. This independence matters for the web platform because it keeps more than one implementation testing and shaping how new CSS and HTML features actually behave in practice, reducing the risk of a single de facto standard drifting from written specifications. Where Blink-based browsers now dominate market share, Gecko's continued development preserves engine diversity. In practice, most people encounter Gecko only indirectly, as the thing making Firefox pages render, print, and support extensions correctly. Web developers care about it because cross-browser testing against Gecko-based Firefox alongside Blink and WebKit remains standard practice for catching engine-specific rendering bugs before shipping a site. Extension and embedding developers who build on Mozilla's platform work with Gecko more directly through its APIs. The trade-off of running a minority engine is that some sites, optimized primarily against Chromium's behavior, occasionally render or perform slightly differently in Gecko, and web developers sometimes deprioritize testing against it. Gecko's codebase is also large and complex, reflecting decades of standards support, which makes it a significant undertaking to maintain relative to newer, narrower rendering projects. Teams choosing a browser engine for an embedded product typically pick based on available tooling and platform support rather than swapping engines casually, so Gecko is best understood as Firefox's engine rather than a general-purpose component to adopt piecemeal.
Key Features
- Parses HTML and CSS into a DOM and style tree for rendering
- Uses the Stylo parallel style system written in Rust
- Supports modern CSS layout including flexbox and grid
- Integrates with SpiderMonkey for JavaScript execution
- Runs across Windows, macOS, and Linux via a platform abstraction layer
- Powers Firefox and select Mozilla embedding projects
- Maintains an independent engine lineage distinct from Blink and WebKit
- Supports Firefox's multi-process and extension architecture