Cumulative Layout Shift Test
What is it?
Cumulative Layout Shift (CLS) measures the total amount that visible elements move around unexpectedly while your page loads. Layout shifts cause users to misclick and feel the page is unstable, and CLS is one of Google's Core Web Vitals and a direct ranking factor.
Why CLS matters
Few user experience problems are as universally frustrating as a button that moves just as the user is about to tap it. CLS quantifies exactly that frustration: the larger and more frequent the unexpected movements, the higher the score and the worse the experience. Google's recommended threshold for a "good" experience is CLS at or under 0.1 at the 75th percentile of users.
The fundamental cause of layout shift is the browser learning the size of an element only after it has already laid out the rest of the page. The fix is to give the browser everything it needs to reserve the correct space upfront: explicit width and height attributes on images, aspect-ratio CSS for responsive containers, fixed-size containers for ads and embeds, and font-loading strategies that do not change line heights when the custom font finally loads. With these in place, late-arriving content fits into its reserved slot rather than pushing other content around.
Common causes of poor CLS
- Images without explicit dimensions: add width and height attributes (or set
aspect-ratioin CSS) so the browser reserves the slot before the image loads. - Late-loading web fonts: use
font-display: swapwith matched fallback metrics so swapping the font does not change line heights. - Aggressively injected cookie consent banners: render them as a fixed overlay rather than as a block element pushing content down.
- Ads or embeds inserted without reserved space: reserve a fixed-size container for each slot.
- Animations on layout-affecting properties: animate
transformandopacityinstead oftop,left, orheight.
This test measures your page's CLS and identifies the elements that contribute most to the score. The fix guide below covers reserving space for images, web font loading strategies, handling cookie banners and ads, and animation patterns that do not trigger layout shift.
Pass rate:
-
Top 100 websites: 91%This value indicates the percent of top 100 most visited websites in the US that pass this test (in the past 12 months).
-
All websites: 81%This value indicates the percent of all websites analyzed in SEO Site Checkup (500,000+) in the past 12 months.
| 2021 | N/A |
|---|---|
| 2022 | 94% |
| 2023 | 94% |
| 2024 | 91% |
100
75
50
25
0
How do I fix it?
Cumulative Layout Shift (CLS) measures the total amount that visible elements move around unexpectedly while the page loads. Layout shifts cause users to misclick and feel the page is unstable, and CLS is one of Google's Core Web Vitals and a direct ranking factor. Fixing this issue means reserving space for everything that loads after first paint so nothing pushes existing content around.
Where to make the change
- Application code or templates: add explicit
widthandheight(or aspect-ratio CSS) to every image, video, and embed so the browser can reserve space before the asset loads. - CSS: use
aspect-ratioon responsive containers; usemin-heighton slots that load content asynchronously (ads, embeds, recommendations). - Cookie consent and overlays: render banners as fixed overlays rather than inserting them at the top of the document.
Common causes and how to resolve them
- Images without dimensions: add
widthandheightattributes (or setaspect-ratioin CSS) so the browser reserves the slot before the image loads. - Late-loading web fonts: use
font-display: swapwithsize-adjustand matched fallback metrics so swapping the font does not change line heights. - Aggressively injected cookie consent banners: render them as a fixed overlay on top of the layout, not as a block element pushing content down.
- Ads or embeds inserted without reserved space: reserve a fixed-size container for each slot so the surrounding content does not jump.
- Animations that move layout-affecting properties: animate
transformandopacityinstead oftop,left, orheight.
Best practices
- Target a CLS score of 0.1 or less at the 75th percentile: the official Core Web Vitals threshold for a "good" experience.
- Reserve space for everything: if it loads after first paint, give it a fixed slot so it cannot push content.
- Animate
transformonly: transform-based animations do not trigger layout and therefore do not produce layout shift. - Test on mobile first: small viewports amplify the perceived impact of layout shifts.