How to Debug Layout Shifts and Lower Your CLS Score
Read layout shifts from a Chrome trace, understand session windows, see which elements moved and why, and plan fixes that bring CLS under 0.1.

How to Debug Layout Shifts and Lower Your CLS Score
Few things annoy visitors more than a page that jumps just as they try to tap a link. Cumulative Layout Shift measures that instability, and a good score is 0.1 or less. Fixing it is usually simple once you know which element moved and why. Finding that out is the hard part, because shifts happen quickly and often only on a first visit.
How CLS is calculated
Each time a visible element moves without the user asking for it, the browser records a layout shift with a score based on how much of the screen moved and how far. Shifts are grouped into session windows. A window keeps collecting shifts while each new one comes less than a second after the previous one, up to five seconds in total. The page's CLS is the largest window total, not the sum of everything. Shifts within half a second of a tap, click or key press are ignored, because the user caused them, such as opening a menu.
This explains a common puzzle: a page with one burst of shifts during load can score worse than a page with several small shifts spread over a minute.
Recording the shifts
In Chrome DevTools, open the Performance panel and record a reload. Scroll down the page as a visitor would, because ads and lazy images often shift content further down. Save the trace and open it in the CLS Layout Shift Debugger.
The tool rebuilds the calculation. It lists every shift with its time, score and window, marks shifts that followed input as excluded, and draws a timeline where the worst window is red. Select a shift and the moved elements are drawn on a scaled screen: the old position as a red dashed box, the new one as a green box. That picture often tells you the cause straight away, for example a block pushed down by something inserted above it.
Likely causes
The debugger also looks at what loaded just before each shift. A web font that finished a moment earlier suggests the fallback font was a different width. An image that arrived just before suggests it had no width and height. An ad request suggests a slot without reserved space. Content moving straight down suggests something was inserted above it, such as a cookie bar or a banner.
Fixing the usual suspects
Give every img, video and iframe width and height attributes, or an aspect-ratio in CSS, so the browser reserves space before the file arrives. Reserve space for ads with a min-height that matches the most common size. Insert banners and notices in reserved containers, or overlay them instead of pushing content. For fonts, use font-display optional, or swap with a fallback adjusted with size-adjust so the swap barely changes line lengths. Animate with transform rather than top or margin.
If you do not have a trace yet, paste the page HTML into the Check HTML tab. It lists unsized media, empty ad slots, fonts without font-display and other common sources.
Plan and prove
Mark a shift as fixed and the tool recalculates the windows to show the CLS you would get. Add a note with the element and the owner of the fix, then export the list. After release, check the field data in Search Console, because real visitors on slower devices may see shifts your recording missed.
Shifts after load
Some of the worst shifts happen long after the page looks ready: a newsletter box that slides in, a late recommendation widget, or an infinite scroll feed that inserts items above the reading position. Record a longer trace that includes scrolling and waiting, and check whether those shifts fall in their own window with a high total.



