designwithfocus

Page speed & performance

What Is Cumulative Layout Shift? The Layout Stability Score

By Design With Focus Team 5 min read
A webpage mockup with a button jumping downward after an image loads

Short answer

Cumulative layout shift measures the largest burst of unexpected layout movement on a page. web.dev calls a good score 0.1 or less and a poor score greater than 0.25, judged at the 75th percentile of page loads. Search Central lists it with Largest Contentful Paint and Interaction to Next Paint as a Core Web Vital for visual stability, and asks for a score less than 0.1.

Last verified against the sources listed below.

Key takeaways

  • CLS is the largest session window of unexpected layout shifts, not a sum of every shift on the page.
  • A session window groups shifts less than 1 second apart, and the window lasts at most 5 seconds.
  • web.dev calls 0.1 or less good and greater than 0.25 poor. Search Central says less than 0.1.
  • Common causes named on web.dev include images without dimensions, web fonts, and ads or widgets that resize.
  • Shifts within 500 milliseconds of a tap, click, or keypress can be excluded. Scrolls and pinches do not count as that input.

What is cumulative layout shift is a question about movement, not about how fast the first byte arrives. web.dev defines CLS as a Core Web Vital for visual stability: how often people hit unexpected layout shifts. A low score means the page stays put.

Search Central groups it with Largest Contentful Paint and Interaction to Next Paint. LCP is loading, INP is responsiveness, and CLS is visual stability. The recommendation there is a CLS score less than 0.1.

What does the score actually count?

It counts the largest burst of unexpected layout shifts over the life of the page. A layout shift is a visible element changing its start position from one frame to the next.

web.dev calls that burst a session window. Shifts in the window sit less than 1 second apart, and the window itself lasts at most 5 seconds. The CLS value is the window whose shifts add up to the highest total, not the sum of every shift the page ever made.

The page notes that an older CLS added every shift across the whole visit. Tools that still expose that older total are called out in web.dev’s note on the change. MDN describes the LayoutShift interface as the Performance API view of those movements. The Layout Instability API is the spec web.dev points at for the entries.

What is a good cumulative layout shift score?

web.dev says sites should aim for 0.1 or less. It tells you to check the 75th percentile of page loads, split by mobile and desktop, so the score reflects most visits rather than one lab run.

Source Good CLS Poor CLS
web.dev 0.1 or less Greater than 0.25
Search Central Less than 0.1 Not given on that page

The two “good” lines are not identical. web.dev includes 0.1. Search Central says less than 0.1.

At the exact boundary, read the tool you are looking at. This page does not rename the gap between 0.1 and 0.25, because the CLS article prints “good” and “poor” and does not label the middle band.

What causes cumulative layout shift?

web.dev names images without dimensions, web fonts, and ads or widgets that resize. Shifts also show up when resources load late or when new DOM nodes land above content that is already on screen.

A size change is not itself a shift. web.dev says a new node, or an element that only grows, counts only when some other visible element changes its start position. That is why reserving the box beats shrinking the file after the jump has already happened.

The optimize guide adds the fixes it wants for those causes. Put width and height on images and videos, or reserve the box with the CSS aspect-ratio property, so the browser can hold the space while the file arrives. For ads and embeds, reserve a slot, and avoid collapsing that slot when nothing returns, because removing the gap shifts the page too.

Web fonts get a similar treatment. font-display: optional uses the web font only if it is already available at first layout, which avoids a second layout. A preload link gives the font a better chance to arrive before first paint. The guide also says injected content near the top of the viewport moves more of the page than the same injection lower down.

How is one layout shift scored?

The browser multiplies two fractions. Impact fraction is how much of the viewport the unstable element covers, counting both its old and new boxes. Distance fraction is how far that element moved, divided by the viewport’s larger side.

web.dev walks a case where an element covers half the viewport and then drops by 25 percent of the height. The union of the two boxes is 75 percent of the viewport, so the impact fraction is 0.75. The move is 25 percent of the height, so the distance fraction is 0.25. The shift score is 0.75 times 0.25, which is 0.1875.

A second picture pushes a green box partly out of view. The impact fraction is 0.5 and the distance fraction is about 0.14, so the score is 0.07. A third picture, a sorted list gaining new rows, is scored at 0.60 times 0.3, or 0.18. Those are the page’s worked examples, not a target you must hit.

Which shifts are expected?

Not every move is a problem. web.dev says a shift is bad when the user did not expect it. A shift within 500 milliseconds of a click, tap, or keypress can be excluded through the hadRecentInput flag.

Scrolls, drags, and pinch-zoom are not that kind of input, so a jump during a scroll still counts. CSS transform is the escape hatch the page names for motion that should not count as layout shift, because the element is not changing its layout position. Animations should also respect prefers-reduced-motion.

Images are a common source of the unexpected kind. Compressing the file does not reserve the box, but a smaller file is what you upload after the width and height are set. The Image Compressor shrinks the picture.

The score itself is one of the three field metrics covered in what page speed is.

Frequently asked questions

What is cumulative layout shift on Shopify?

The score is not a Shopify setting. web.dev defines it in the browser, from elements that move between frames, so a Shopify storefront is measured the same way as any other site. This guide did not find a Shopify help page that publishes a separate Shopify score, and none is invented here. If a product image has no width and height, web.dev's optimize guide still treats that as a cause, whether the theme came from Shopify or from hand-written HTML.

What is the cumulative layout shift score formula?

web.dev writes layout shift score as impact fraction times distance fraction. Impact fraction is the share of the viewport covered by the union of an unstable element's old and new positions. Distance fraction is the greatest move of any unstable element, divided by the viewport's larger side. One worked example on the page is 0.75 times 0.25, which equals 0.1875. A second example is 0.5 times 0.14, which equals 0.07.

Which layout shifts are left out of the score?

A shift that follows user input within 500 milliseconds gets the hadRecentInput flag and can be excluded, web.dev says. The flag covers discrete events such as tap, click, and keypress. Scrolls, drags, and pinch or zoom gestures are not treated as recent input, so a shift during those still counts. Adding a new element, or resizing one, is not itself a shift unless some other visible element changes its start position.

Did CLS used to add every shift together?

Yes. web.dev says CLS previously summed every individual layout shift across the whole life of the page. The current definition keeps the largest burst, called a session window, instead of that lifetime total. The page points readers who still need the old number at a note on how tools report the earlier implementation. A long page can therefore score lower now than it would have under the old sum, even with the same shifts.

Sources