---
title: "Critical rendering path"
description: "The critical rendering path is the steps a browser must finish before it paints a page: HTML, CSS, render tree, layout and paint. Shorter means faster."
url: https://ursy.com/wiki/critical-rendering-path/
updated: 2026-11-24T23:06:41+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/critical-rendering-path/
---

# Critical rendering path

> The critical rendering path is the steps a browser must finish before it paints a page: HTML, CSS, render tree, layout and paint. Shorter means faster.

**The critical rendering path is the set of steps a browser must finish before it can draw the first pixels of a page: read the HTML, read the CSS, combine them, work out the layout and paint the screen.** Anything that holds up those steps, such as a large stylesheet or a script in the head, delays the moment a visitor sees your page. Shorten the path and the page appears sooner.

## What is the critical rendering path? {#what-is-the-critical-rendering-path}

When a browser loads a page it gets 3 kinds of code: [HTML](https://ursy.com/wiki/html/) for the content, [CSS](https://ursy.com/wiki/css/) for the look, and JavaScript for behaviour. It cannot show anything useful until it knows both what is on the page and how it should look. The [MDN guide](https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/Critical_rendering_path) breaks the work into 5 steps:

1. **Build the DOM.**  The browser reads the HTML and turns it into a tree of nodes, the [Document Object Model](https://ursy.com/wiki/dom-document-object-model/). This can happen bit by bit as the HTML arrives.
2. **Build the CSSOM.**  It reads every stylesheet into a second tree. This step is not done bit by bit, because a later rule can overwrite an earlier one.
3. **Build the render tree.**  It joins the 2 trees and keeps only what will show. Anything set to `display: none` is left out.
4. **Layout.**  It works out the size and place of each box for the screen in front of it.
5. **Paint.**  It draws the pixels.

The “critical” part is everything needed for the first view. The rest can wait.

## What blocks the path? {#what-blocks-the-path}

### CSS blocks rendering {#css-blocks-rendering}

web.dev’s article on [render-blocking CSS](https://web.dev/articles/critical-rendering-path/render-blocking-css) says CSS is treated as render-blocking by default. The browser waits until it has the stylesheets so it does not show an unstyled page. A stylesheet with a `media` attribute that does not match, such as `media="print"`, does not block the first render. The browser still downloads it, just at a lower priority.

### JavaScript blocks parsing {#javascript-blocks-parsing}

web.dev’s article on [adding interactivity with JavaScript](https://web.dev/articles/critical-rendering-path/adding-interactivity-with-javascript) says a script blocks DOM construction unless it is marked `async`. The browser stops reading HTML, fetches the script and runs it. There is a second catch: because scripts can read styles, the browser also waits for the CSSOM before it runs them. So a script in the head can be stuck behind a stylesheet, and the HTML is stuck behind both.

## Why does it matter for search? {#why-does-it-matter-for-search}

A slow first view hurts people, and [Google](https://ursy.com/wiki/google/) measures how pages feel to real visitors through [Core Web Vitals](https://ursy.com/wiki/core-web-vitals/). The most closely tied one is [Largest Contentful Paint](https://ursy.com/wiki/largest-contentful-paint/). web.dev’s [LCP article](https://web.dev/articles/lcp) says a good score is 2.5 seconds or under, and that you should judge it on the 75th percentile of loads, split by phone and desktop. Nothing can be painted, including the main image or heading, until the render-blocking files are in. A long path pushes LCP up. It also tends to show up as a slow [page speed](https://ursy.com/wiki/page-speed/) score in [Google Lighthouse](https://ursy.com/wiki/google-lighthouse/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

Not every crawler waits for scripts to build the page. Some read the raw HTML as text and move on. Google says in its [JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics) that [server-side rendering](https://ursy.com/wiki/server-side-rendering/) or pre-rendering is still a great idea, partly because not all [bots](https://ursy.com/wiki/bot-web-robot/) can run JavaScript. A lean path usually goes with a page whose main words are in the HTML from the start, which is good for [rendering](https://ursy.com/wiki/rendering/) by [search engines](https://ursy.com/wiki/search-engine/) and for being read by an [AI crawler](https://ursy.com/wiki/ai-crawler/). See [JavaScript SEO](https://ursy.com/wiki/javascript-seo/) for more.

## How do you shorten it? {#how-do-you-shorten-it}

MDN gives 3 aims: fewer critical files, smaller and fewer requests, and the right load order. In practice:

- **Defer scripts.**  Add `defer` or `async` to scripts that are not needed for the first view. Chrome’s [render-blocking resources audit](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources) flags any head script with neither.
- **Inline critical CSS.**  Put the few rules needed for the top of the page in a `<style>` block in the head, and load the rest later.
- **Split CSS by media.**  Give print or large-screen styles their own file with a matching `media` attribute.
- **Cut unused code.**  The Coverage tab in Chrome DevTools shows how much loaded CSS and JavaScript is not used.
- **Minify.**  Smaller files arrive sooner. Our [JavaScript minifier](https://ursy.com/webmaster-tools/javascript-minifier/) does this in your browser.
- **Keep the DOM small.**  MDN notes that more nodes slow every later step.
- **Serve fast.**  A slow [time to first byte](https://ursy.com/wiki/time-to-first-byte/) delays the whole path. [Caching](https://ursy.com/wiki/caching/) and a [CDN](https://ursy.com/wiki/cdn/) help.

## Common mistakes {#common-mistakes}

- **Loading 5 font files and 3 sliders in the head**  for a page that shows one heading first.
- **Adding async to everything.**  Scripts that depend on each other can then run in the wrong order. `defer` keeps order.
- **Hiding the main content until a script runs.**  The page looks blank, and some bots see nothing.
- **Lazy-loading the hero image.**  [Lazy loading](https://ursy.com/wiki/lazy-loading/) helps images lower down, but delays the one that is often the LCP element.
- **Fixing one plugin and adding 2 more.**  Check again after every change.

## A worked example {#a-worked-example}

A florist’s home page loads 4 stylesheets and 6 scripts in the head. Lighthouse lists 7 of them as render-blocking. The team:

1. marks 5 scripts as `defer`, since none are needed before the first paint;
2. moves the chat widget script to load after the page;
3. inlines about 40 lines of CSS for the header and hero, and loads the full sheet after;
4. gives the print stylesheet `media="print"`.

The next Lighthouse run lists 1 render-blocking file instead of 7. Field data from real visitors moves more slowly than a lab test, so they check the Core Web Vitals report in [Search Console](https://ursy.com/wiki/google-search-console/) again a month later.

## How to check it {#how-to-check-it}

- Run Lighthouse in Chrome DevTools and open “Eliminate [render-blocking resources](https://ursy.com/wiki/render-blocking-resources/)”.
- Use the Performance panel to see when the first paint happens and what waited for what.
- Two tools of ours are coming soon for this: a [speed test](https://ursy.com/page-speed-checker/) and a [Core Web Vitals check](https://ursy.com/core-web-vitals-checker/). Our [JavaScript SEO checker](https://ursy.com/javascript-seo-checker/) will show what a page says before scripts run.
- Our [HTTP header checker](https://ursy.com/http-header-checker/) shows caching and compression headers today.
- For ongoing tracking, our [real user speed](https://ursy.com/pro/real-user-speed/) report is Pro.

## Related words {#related-words}

- [Cumulative Layout Shift](https://ursy.com/wiki/cumulative-layout-shift/)
- [Interaction to Next Paint](https://ursy.com/wiki/interaction-to-next-paint/)
- [Above the fold](https://ursy.com/wiki/above-the-fold/)
- [Why your website is slow](https://ursy.com/wiki/why-your-website-is-slow/)
- [WebP and AVIF](https://ursy.com/wiki/webp-and-avif/)

## Sources {#sources}

- [MDN Web Docs: Critical rendering path](https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/Critical_rendering_path), checked 24 November 2026
- [web.dev: Render-blocking CSS](https://web.dev/articles/critical-rendering-path/render-blocking-css), checked 24 November 2026
- [web.dev: Adding interactivity with JavaScript](https://web.dev/articles/critical-rendering-path/adding-interactivity-with-javascript), checked 24 November 2026
- [Chrome for Developers: Eliminate render-blocking resources](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources), checked 24 November 2026
- [web.dev: Largest Contentful Paint (LCP)](https://web.dev/articles/lcp), checked 24 November 2026
- [Google Search Central: Understand JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics), checked 24 November 2026

*Updated 24 November 2026 by URSY.*
