Quick answer
The critical rendering path is the sequence a browser completes before the first paint: build the DOM from HTML, build the CSSOM from CSS, run parser-blocking scripts, combine them into a render tree, compute layout, then paint and composite. Render-blocking CSS and scripts on it delay FCP and LCP.
What is the critical rendering path?
The critical rendering path is the sequence of steps a browser must complete before it can paint the first pixels of a page: download and parse the HTML into the DOM, download and parse CSS into the CSSOM, run any scripts that block parsing, combine DOM and CSSOM into a render tree, compute layout, then paint and composite. Every resource the browser has to wait for during those steps is a critical resource.
The path matters because it sets a floor under how fast a page can show anything. A page whose <head> contains one 48 KB stylesheet and one synchronous script cannot paint until both have arrived and the script has run, however fast the rest of the page is. Optimizing the critical rendering path means shortening that chain: fewer critical resources, fewer bytes in them and fewer round trips before the first render.
The six steps from HTML to pixels
| Step | Input | Output | What can make it wait |
|---|---|---|---|
| 1. Build the DOM | HTML bytes | Document Object Model | Slow server response; synchronous <script> tags pause parsing |
| 2. Build the CSSOM | CSS from <link> and <style> | CSS Object Model | Every stylesheet that applies to the current media must be downloaded and parsed |
| 3. Run blocking JavaScript | Scripts without async or defer | Changes to DOM or CSSOM | A synchronous script waits for earlier CSS, then runs on the main thread |
| 4. Build the render tree | DOM + CSSOM | Visible nodes with computed styles | Needs both trees complete for the content in view |
| 5. Layout | Render tree + viewport size | Position and size of every box | Large DOMs and forced re-layouts from scripts |
| 6. Paint and composite | Layout | Pixels on screen, layers combined | Expensive effects; large images decoding |
Steps 1 to 3 are where most avoidable delay lives, because they involve the network. Steps 4 to 6 are CPU work on the main thread; they become the bottleneck on slow phones and on pages with very large DOMs.
Which resources block rendering?
Two kinds of blocking matter. Render-blocking resources stop the browser from painting. Parser-blocking resources stop the HTML parser from reading further, which also delays the discovery of everything after them.
| Resource | Blocks parsing? | Blocks rendering? | Fix |
|---|---|---|---|
<link rel="stylesheet"> (matching media) | No | Yes | Inline the CSS needed for the first view; load the rest without blocking |
<link rel="stylesheet" media="print"> | No | No (media does not match) | Use media for conditional styles |
<script src> without attributes | Yes | Yes, when in <head> | Add defer, or move to the end of <body> |
<script defer> | No | No | Runs after parsing, in document order |
<script async> | No (pauses only while it executes) | No | Use for independent scripts such as analytics |
<script type="module"> | No (deferred by default) | No | Already non-blocking |
| Images, video | No | No | Reserve space with width and height; preload the LCP image |
| Web fonts | No | Text can be hidden until the font loads | font-display: swap or optional; preload the main font |
Browsers soften parser blocking with a preload scanner that looks ahead in the raw HTML for images, scripts and stylesheets while the main parser is stuck. It only finds what is written in the HTML. Resources referenced from inside CSS (background images, fonts) or injected by JavaScript are discovered late, which is why a CSS background used as the hero image often ends up as a slow Largest Contentful Paint.
A waterfall worked example
Sample data, simplified (no bandwidth contention between files): a product page on a mobile connection. The server delivers the first HTML byte at 0.60 s and the browser has parsed the <head> by 0.70 s. The <head> holds:
styles.css, 48 KB, render-blocking, finishes downloading at 1.35 s;app.js, 120 KB, synchronous, finishes downloading at 1.50 s and runs for 0.18 s, so it is done at 1.68 s;- the hero image is a CSS background (0.90 s to download), so the browser only requests it once rendering can start.
Allow 0.02 to 0.05 s for style, layout and paint after the last blocker clears.
| Version | Last render blocker clears | FCP | Hero image requested → loaded | LCP |
|---|---|---|---|---|
| Baseline | app.js done at 1.68 s | 1.68 + 0.02 = 1.70 s | 1.70 → 2.60 s | 2.65 s |
A: add defer to app.js | CSS at 1.35 s | 1.35 + 0.05 = 1.40 s | 1.40 → 2.30 s | 2.35 s |
B: A + inline critical CSS + <link rel="preload"> for the hero | <head> parsed at 0.70 s | 0.70 + 0.05 = 0.75 s | 0.70 → 1.60 s | 1.65 s |
What the table shows:
- Deferring one script moved FCP by 0.30 s because the script, not the CSS, was the last blocker. Removing a blocker that is not the last one changes nothing until the last one is gone.
- The LCP gain in B came mostly from discovery. The image took 0.90 s in every version; preload simply started that 0.90 s at 0.70 s instead of 1.40 s.
- Field thresholds: web.dev rates FCP good at 1.8 s or less and LCP good at 2.5 s or less (75th percentile). The baseline passes FCP and misses LCP; version B passes both with room to spare.
Why inline critical CSS should stay small: RFC 6928 lets a TCP connection start with an initial congestion window of 10 segments, about 14,600 bytes (10 × 1,460). HTML that fits the critical CSS into roughly the first 14 KB can render after one round trip; every additional window costs another round trip, which on a mobile connection with a 150 ms round-trip time adds 0.15 s each.
Critical rendering path vs FCP and LCP
The critical rendering path is a process; First Contentful Paint and Largest Contentful Paint are measurements of when parts of that process finish.
| What it is | Measured as | Affected by the critical path? | |
|---|---|---|---|
| Critical rendering path | Steps and resources before the first render | Count of critical resources, critical bytes, round trips | — |
| Time to First Byte | Server and network time before HTML arrives | Seconds | Comes before it; sets its starting point |
| First Contentful Paint | First text or image painted | Seconds | Directly: FCP cannot happen before the path completes |
| Largest Contentful Paint | Largest element in view painted | Seconds | Strongly, plus late discovery and size of the LCP resource |
| Interaction to Next Paint | Delay of responses to clicks and taps | Milliseconds | Indirectly; it is mostly main-thread work after load, covered in minimize main thread work |
How to find the blocking resources on your page
- Record a load in the browser's Performance panel with network and CPU throttling set to a mid-range phone. Find the first paint marker and look at which requests finished just before it.
- Check the Network waterfall for stylesheets and scripts that start early and end just before first paint; those are your critical resources.
- Query the Resource Timing API. In Chromium browsers,
performance.getEntriesByType('resource')exposesrenderBlockingStatus, which lists each resource as blocking or non-blocking. - Run a lab audit for render-blocking resources and the LCP request's discovery time.
- Confirm with field data, because lab runs use one device and one network.
Common mistakes
- Adding
asyncto scripts that depend on each other.asyncruns in download order, not document order; usedeferfor ordered scripts. - Lazy-loading the hero image.
loading="lazy"on the LCP image delays it. - Inlining all the CSS. Inline only what the first screen needs; inlining everything makes the HTML larger than the first congestion window.
- Measuring only in the lab. A fast developer laptop hides CPU-bound steps 4 to 6.
Checking a critical-path fix with real-user data in TapCub
Take version A of the example: you add defer to app.js and want to know whether visitors actually see a faster first paint.

- Open Monitoring › Performance. The cards show LCP, CLS, INP, FCP and TTFB from real loads in visitors' browsers, not a lab run, with the share rated good. FCP is good at 1.8 s or less and poor above 3 s; LCP is good at 2.5 s or less and poor above 4 s.
- Read P75 and break down by page and device. Filter to the product page template and to mobile, where the blocking script hurt most. The Slowest pages list is sorted by P75 LCP.
- Split the load. Load timing divides a page load into backend (time to first byte), network transfer and frontend render, so you can see whether the remaining time sits on the server or in the browser.
- Mark the release. The performance page has no previous-period comparison, so add the deploy date in Configuration › Annotations and compare the week before with the week after. Pages with few samples jump between percentiles; wait for enough loads.
TapCub reports the field metrics; it does not change your HTML or tell you which file to defer.
Sources
- web.dev, Understanding the critical path.
- MDN Web Docs, Critical rendering path.
- WHATWG HTML Standard, The script element (async and defer).
- IETF, RFC 6928: Increasing TCP's Initial Window (April 2013).
- web.dev, First Contentful Paint (FCP) and Largest Contentful Paint (LCP) thresholds.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Engineer
Writes about event design, data quality, and collection workflows, with verifiable implementation methods for reliable analytics.