Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    How web browsers work: from URL to pixels on screen

    When you open a page, the browser looks up the site's IP address, opens a connection (encrypted for HTTPS) and requests the HTML.[1][2][3] It parses the HTML and CSS into trees called the DOM and CSSOM, combines them into a render tree, works out where everything goes and paints pixels on screen.[4][5][6] Chromium runs web content in separate processes it can sandbox, and the same-origin policy restricts how one site's scripts can interact with another site's resources.[7][8][9]

    Editor reviewedUpdated Explainer21 claims · 24% primaryComputing, Internet and telecoms
    Reading level: 1 passage differs; the rest is the same for everyone.

    This page follows MDN’s description of page loading and the Chromium project’s design documents. Browser engines differ in detail.

    The building blocks

    Web pages are written in HTML, which the WHATWG standard calls the World Wide Web’s core markup language, originally designed mainly for describing scientific documents.[10] In 2019 the WHATWG and W3C agreed to collaborate on a single version of HTML, the WHATWG’s Living Standard.[11] Inside a browser, JavaScript can be connected to the page’s objects to control them.[12] The JavaScript language specification does not cover the Document Object Model (DOM), the interface scripts use to work with a page, which is standardized separately by the W3C and the WHATWG.[13]

    Fetching the page

    Loading starts with navigation, when a user enters a URL, clicks a link or submits a form.[14] The browser first requests a DNS lookup, which a name server answers with an IP address that is usually cached afterwards; a separate lookup is needed for each unique hostname the page uses.[1] It then opens a TCP connection with a three-way handshake, and for HTTPS a TLS negotiation chooses the encryption cipher and verifies the server before any data is sent.[2] Finally it sends an HTTP GET request, usually for an HTML file, and the server replies with headers and the HTML content.[3] See how DNS works and how the internet works for the network side.

    Turning code into a page

    The browser reads the HTML and CSS and builds two trees in memory: the DOM for the page’s content and the CSSOM for its styles.[4] It combines them, works out the size and position of everything visible, and then paints the result as pixels on the screen.[5][6]

    Parsing turns network data into the DOM and CSSOM; building the DOM involves tokenizing the HTML and constructing a tree.[4] Script elements without async or defer block rendering and pause HTML parsing, while a preload scanner fetches CSS, JavaScript and web fonts in the background.[15] The DOM and CSSOM are combined into a render tree, layout computes each visible node’s geometry, and later recalculations are called reflows.[5] Painting rasterizes each box into pixels; content can be promoted to GPU layers, which must then be composited in the right order.[6]

    The DOM stays live after loading: it represents the page as a tree in memory, and scripts use DOM methods to change its structure, style or content.[16]

    Running JavaScript and staying responsive

    Browsers parse JavaScript into abstract syntax trees, some engines compile those into bytecode, and most code runs on the main thread except code in web workers.[17] All major browsers use JavaScript engines with built-in just-in-time compilers.[18] The main thread has a tight budget: for smooth scrolling and animation, style calculation, reflow and paint must take less than 16.67 milliseconds, and while the thread is busy running JavaScript it cannot respond promptly to user input.[19] For how engines run scripts, see how compilers and interpreters work.

    Processes, sandboxes and the same-origin policy

    Chromium runs a browser process for the user interface and separate renderer processes for web content, to protect the whole application from bugs in the rendering engine.[7] When a renderer crashes, the affected tabs show a “sad tab” image and can be reloaded, and because renderers are separate processes Chromium can sandbox them, for example limiting their network access to its own network service.[8] It has also split out a GPU process, a network service and a storage service.[20]

    Inside the page, the same-origin policy limits how a document or script from one origin can interact with resources from another; two URLs share an origin only if their protocol, port and host match.[9] It stops, for example, a malicious site from using JavaScript to read data from a webmail service the user is signed in to.[21] How browsers handle cookies and tracking is covered in how cookies and web tracking work.

    Developing in AI & Computing

    Go deeper

    Questions readers ask

    What happens when I type a web address?

    The browser requests a DNS lookup to get the site's IP address, opens a TCP connection (plus a TLS handshake for HTTPS) and sends an HTTP GET request, usually for an HTML file.[14][1][2][3]

    What is the DOM?

    The Document Object Model represents a web page as a tree in memory. Scripts use DOM methods to change the page's structure, style or content.[16]

    Why do pages sometimes freeze while loading?

    Much of the work happens on one main thread. While it is busy parsing, compiling and running JavaScript, it cannot respond promptly to taps or clicks.[19]

    Why does one crashed tab not close the whole browser?

    Chromium runs web content in separate renderer processes. When one crashes, the affected tabs show a "sad tab" image and can be reloaded.[7][8]

    What is the same-origin policy?

    A security rule that limits how a script from one origin (protocol, host and port) can interact with resources from another. It stops a malicious site from reading data from a webmail account you are signed in to.[9][21]

    Who sets the rules for HTML?

    The WHATWG publishes the HTML Living Standard, and in 2019 the WHATWG and W3C agreed to work on that single version of HTML.[11]

    Sources

    · 21 claims from 3 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      To find a site, the browser requests a DNS lookup that a name server answers with an IP address, which is then usually cached; a separate lookup is needed for each unique hostname a page references. reportedas of 2026-11-14

    2. [2]

      With the IP address known, the browser opens a TCP connection with a three-way handshake, and for HTTPS a further TLS negotiation chooses the encryption cipher and verifies the server before data is sent. reportedas of 2026-11-14

    3. [3]

      Once connected, the browser sends an HTTP GET request, usually for an HTML file, and the server replies with response headers and the HTML content. reportedas of 2026-11-14

    4. [4]

      Parsing turns the data received over the network into the DOM and CSSOM, which the renderer uses to paint the page; building the DOM involves tokenizing the HTML and constructing a tree. reportedas of 2026-11-14

    5. [5]

      The browser combines the DOM and CSSOM trees into a render tree, then runs layout to work out the size and position of every visible element; later recalculations are called reflows. reportedas of 2026-11-14

    6. [6]

      In the paint step the browser converts each laid-out box into pixels on screen; content can be split into layers painted on the GPU, which must then be composited in the right order. reportedas of 2026-11-14

    7. [7]

      Chromium runs a browser process for the user interface and separate renderer processes for web content, using multiple processes to protect the whole application from bugs in the rendering engine; its renderers use the Blink layout engine. confirmedas of 2026-11-14

    8. [8]

      When a Chromium renderer process crashes, the affected tabs show a "sad tab" image and can be reloaded, and because renderers run in separate processes Chromium can sandbox them, for example limiting their network access to its network service. confirmedas of 2026-11-14

    9. [9]

      The same-origin policy restricts how a document or script from one origin can interact with resources from another; two URLs share an origin only if their protocol, port and host match. reportedas of 2026-11-14

      • Same-origin policy · MDN Web Docs (Mozilla) · Secondary source · Same-origin policy, first paragraph (retrieved 2026-11-14)
      • Same-origin policy · MDN Web Docs (Mozilla) · Secondary source · Definition of an origin (retrieved 2026-11-14)
    10. [10]

      The WHATWG HTML standard calls HTML the World Wide Web's core markup language, originally designed for semantically describing scientific documents. confirmedas of 2026-11-14

    11. [11]

      In 2019 the WHATWG and W3C agreed to collaborate on a single version of HTML, the WHATWG's HTML Living Standard. confirmedas of 2026-11-14

    12. [12]

      Inside a host environment such as a web browser, JavaScript can be connected to the objects of that environment to control them. reportedas of 2026-11-14

    13. [13]

      The ECMAScript specification does not describe the Document Object Model (DOM), which is standardized by the W3C and/or the WHATWG. reportedas of 2026-11-14

    14. [14]

      Navigation, the first step in loading a web page, happens whenever a user enters a URL, clicks a link or submits a form. reportedas of 2026-11-14

    15. [15]

      Script elements without an async or defer attribute block rendering and pause HTML parsing, while the browser's preload scanner fetches high-priority resources such as CSS, JavaScript and web fonts in the background. reportedas of 2026-11-14

    16. [16]

      The Document Object Model (DOM) represents a document such as a web page as a tree in memory, and DOM methods let scripts change the document's structure, style or content. reportedas of 2026-11-14

      • Introduction to the DOM · MDN Web Docs (Mozilla) · Secondary source · Introduction to the DOM, first paragraph (retrieved 2026-11-14)
      • Introduction to the DOM · MDN Web Docs (Mozilla) · Secondary source · Introduction to the DOM, second paragraph (retrieved 2026-11-14)
    17. [17]

      Browsers parse JavaScript into abstract syntax trees, and some engines pass those trees to a compiler that outputs bytecode; most code then runs on the browser's main thread, except code in web workers. reportedas of 2026-11-14

    18. [18]

      JIT compilers are usually built into software runtimes to improve performance rather than run directly, and all major browsers use JavaScript engines with built-in JIT compilers. reportedas of 2026-11-14

      • Compile · MDN Web Docs (Mozilla) · Secondary source · Glossary: Compile (retrieved 2026-11-14)
    19. [19]

      For smooth scrolling and animation, the work on the browser's main thread, including style calculation, reflow and paint, must take less than 16.67 milliseconds, and while the main thread is busy running JavaScript it cannot respond promptly to user input. reportedas of 2026-11-14

    20. [20]

      Chromium has also split other components into separate processes, including a GPU process, a network service and a storage service. confirmedas of 2026-11-14

    21. [21]

      The same-origin policy stops, for example, a malicious website from using JavaScript in the browser to read data from a webmail service the user is signed in to. reportedas of 2026-11-14

      • Same-origin policy · MDN Web Docs (Mozilla) · Secondary source · Same-origin policy, second paragraph (retrieved 2026-11-14)
    Revision history (1)
    1. Page created.

    Created Nov 14, 2026. Last reviewed by an editor on Nov 14, 2026. Next scheduled review: Aug 14, 2027.

    Cite this page

    "How web browsers work: from URL to pixels on screen." ContentLora, updated Nov 14, 2026. https://contentlora.com/explain/how-web-browsers-work

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.