Guide

What Is Cumulative Layout Shift (CLS) and How Do You Fix It?

Cumulative Layout Shift, or CLS, measures how much a page's layout unexpectedly moves while it is loading. You have almost certainly experienced a high-CLS page — you begin reading an article, an advert loads above the text and pushes everything down, and you lose your place. Or you go to tap a button and a banner appears at the last moment, sending your tap somewhere unintended.

Google introduced CLS as a Core Web Vital because layout instability is one of the most frustrating experiences on the web. It measures the total visual instability of a page throughout its load, assigning a score based on how much elements move and how large those elements are. A low CLS score is a requirement for a good page experience assessment.

How CLS Is Calculated

Each layout shift is scored by multiplying two factors: the impact fraction (the proportion of the viewport affected by the shift) and the distance fraction (how far the element moved as a proportion of the viewport). A large element shifting a small distance and a small element shifting a large distance can both produce significant CLS scores.

The Cumulative Layout Shift score is the sum of all individual layout shift scores that occur without 500 milliseconds of user input. Shifts caused directly by user interaction — such as expanding an accordion or clicking to reveal more content — are excluded from the score, as these are intentional. Only unexpected shifts that surprise the user are counted.

What Causes High CLS

The most common cause of CLS is images without explicit width and height attributes. When a browser encounters an img tag without dimensions, it cannot reserve space for it before the image downloads. Once the image arrives and the browser knows its size, the surrounding content is pushed out of the way. Always include width and height attributes on all images.

Web fonts cause CLS when they replace a fallback font and the two fonts have different metrics, causing text to reflow. Adverts and embeds with unknown dimensions shift content when they load. Late-loading banners, cookie consent notices that push content, and dynamically injected content are all common culprits. Animations that move elements outside the viewport do not cause CLS, but those that move content within the viewport do.

How to Fix CLS

Add explicit width and height attributes to every image and video element. Modern CSS with aspect-ratio can also help reserve space for responsive images. For adverts and embeds, pre-allocate space with a fixed-height container so that when the content loads it fills the reserved space rather than pushing other content.

For web fonts, use font-display: optional or font-display: swap with adjusted metrics to minimise the visual difference between fallback and loaded fonts. The CSS font-size-adjust property and tools like Font Style Matcher can help match your fallback font metrics to your chosen web font. Avoid injecting content above existing content after the initial load — if you must add a banner or notification, append it below the fold or overlay it without affecting document flow.

FAQs

Common questions.

What CLS score is considered good?
Google classifies CLS as good at 0.1 or below, needs improvement between 0.1 and 0.25, and poor above 0.25. CLS is a dimensionless score rather than a time measurement. Most well-built sites can achieve a score well below 0.1 by following basic best practices for image sizing and content injection.
Does CLS affect my SEO?
Yes. CLS is a Core Web Vital included in Google's page experience signal, which influences organic rankings. Beyond ranking considerations, high CLS directly damages user experience — when users cannot interact with a page reliably because elements keep moving, engagement rates and conversions suffer.
How do I measure CLS on my own website?
PageSpeed Insights shows both lab and field CLS data for your pages. Google Search Console's Core Web Vitals report aggregates field data across your entire site, flagging pages with poor CLS. The Chrome DevTools Performance panel and Lighthouse audit can show you individual layout shift events and identify which elements are shifting.
Related guides

More on web design & ux.

Want a hand putting this into practice?

Book a free, no-obligation consultation with a Norwich-based specialist.

Book a free consultation
Get started

Let's put your business in a better light.

Book a free, no-pressure consultation. We'll talk through your goals and tell you honestly what we'd do — whether you work with us or not.

  1. 01
    Tell us a bitFill in the form — two minutes, tops.
  2. 02
    We'll call you backWithin one working day, no pressure.
  3. 03
    Get a clear planHonest advice and a fixed quote.

Free · No obligation · We reply within one working day

Book a free consultation