Part of the Core Web Vitals series. For the full picture, start with Core Web Vitals: what they are, how they affect SEO and how to improve them.
Few things annoy visitors more than tapping a link just as the page jumps and hitting an ad instead. Cumulative Layout Shift puts a number on that experience. It’s also the Core Web Vital where lab tools are most misleading, because the worst shifts often happen after the page has finished loading.
This guide explains how CLS is calculated, why field and lab disagree, and how to fix the common causes.
What is Cumulative Layout Shift?
CLS measures how much visible content moves unexpectedly. web.dev defines it as “the largest burst of layout shift scores for every unexpected layout shift” during the page’s life (CLS).
How the number is built:
- Each shift gets a score: “layout shift score = impact fraction * distance fraction”. The impact fraction is how much of the viewport the moving elements affect; the distance fraction is how far they move, relative to the viewport’s largest dimension.
- Shifts are grouped into bursts (session windows): shifts less than 1 second apart belong to the same burst, up to 5 seconds per burst.
- CLS is the worst burst in the visit, not the sum of every shift.
Expected shifts don’t count. Shifts within 500 milliseconds of a user input, like a click that expands a section, are excluded. Scrolling and pinching don’t qualify for that exclusion.
What is a good CLS?
| Rating | CLS at the 75th percentile |
|---|---|
| Good | 0.1 or less |
| Needs improvement | Over 0.1 and up to 0.25 |
| Poor | Over 0.25 |
Why do lab and field CLS disagree?
Lab tools like Lighthouse measure a single page load without interaction. Real visits last longer: people scroll, ads refresh, cookie banners appear, infinite lists load more items. As web.dev puts it, lab tools “typically report lower CLS values” than users experience, because shifts “can occur throughout the page’s lifetime.” A Lighthouse CLS of 0 doesn’t mean the field value is good.
What causes layout shifts, and how do you fix them?
web.dev’s CLS optimisation guide names the most common causes: “Images without dimensions. Ads, embeds, and iframes without dimensions. Dynamically injected content such as ads, embeds, and iframes without dimensions. Web fonts.” Add animations and you have almost every case:
| Cause | Fix |
|---|---|
| Images and videos without dimensions | “Always include width and height size attributes on your images and video elements”, or reserve space with CSS aspect-ratio |
| Ads, embeds and iframes | Reserve the space “in the initial layout”, for example with a min-height on the slot, sized for the most likely ad |
| Content injected above existing content | Don’t insert banners, notices or recommendations above what the user is reading; place them in a reserved container or below, or “have the user initiate the load of new content” |
| Web fonts | font-display: optional, and match the fallback font’s metrics with size-adjust, ascent-override, descent-override and line-gap-override |
| Animations | Animate with transform instead of properties like top or left that trigger layout |
Two patterns cause a disproportionate share of field CLS: cookie and consent banners that push content down instead of overlaying it, and late-loading ad slots with no reserved height. Check both first.
How do you find the shifts?
In the field, the Layout Instability API records shifts in real visits; real-user monitoring tools use it to tell you which elements moved.
In the lab, the DevTools Performance panel shows layout shift clusters, and Lighthouse lists the elements that shifted and images without explicit dimensions. Reproduce the user’s path, including scrolling, not just the load.
Across a site, in Crawlens, Measure Core Web Vitals or Real-user data for all pages pulls CrUX data, and the audit flags Poor CLS for real users (over 0.25) and Core Web Vitals need improvement. Because CLS problems are almost always template-wide, sort the flagged URLs by path: a whole /blog/ or /product/ section failing points to a shared component like an ad slot, an embed or the hero image.
How do you confirm the fix?
Re-run the scenario in DevTools, including scrolling and waiting for late content. Field CLS updates over the 28-day CrUX window. In Crawlens, measure again and use Compare to see which pages left the poor range.
For how CLS fits with the other Core Web Vitals, see the Core Web Vitals guide.
Checklist
- Width and height (or aspect-ratio) on every image and video
- Space reserved for ads, embeds and iframes
- No content injected above what the user is reading
- Consent and cookie banners overlay rather than push content
- Web fonts use font-display: optional or a fallback with matched metrics
- Animations use transform
- Shifts checked while scrolling, not just on load
- Field CLS of 0.1 or less at the 75th percentile
Frequently asked questions
What is a good CLS score?
0.1 or less at the 75th percentile of page visits. Between 0.1 and 0.25 needs improvement, and over 0.25 is poor.
Why is CLS higher in field data than in Lighthouse?
Lighthouse only measures shifts during the initial page load. Real users scroll, interact and keep the page open, and shifts later in the visit, such as ads loading or content injected on scroll, also count towards CLS.
Do layout shifts caused by clicks count?
Not if they happen within 500 milliseconds of a user input, such as a click that opens an accordion. Those are expected shifts. Continuous interactions like scrolling don't qualify for the exclusion.
How do I stop images from causing layout shifts?
Add width and height attributes to every image and video, or reserve the space with CSS aspect-ratio. The browser can then allocate the right space before the file loads.
Do web fonts cause CLS?
They can, when text first renders in a fallback font and then reflows in the web font. Using font-display: optional and matching the fallback's metrics with size-adjust and related descriptors reduce the shift.