Skip to content

Monitoring glossary

What is CLS (Cumulative Layout Shift)?

Cumulative Layout Shift measures how much the page jumps around unexpectedly while people use it. It is the Core Web Vital for visual stability.

3 min read10 sectionsUpdated

On this page

Key points

  • Good CLS is 0.1 or less at the 75th percentile; above 0.25 is poor.
  • Each shift is scored as impact fraction × distance fraction.
  • CLS is the largest burst of shifts in a session window, not the sum over the whole visit.
  • Shifts within 500 ms of a user input do not count.

How it is calculated

When a visible element moves between frames without a user action, the browser records a layout shift with a score:

plaintext
layout shift score = impact fraction × distance fraction

impact fraction   = share of the viewport affected by the moving elements (before + after)
distance fraction = greatest distance moved ÷ viewport's largest dimension

Example

A banner loads late and pushes the content down. The moving content covers 60% of the viewport across both frames, and it moves by 25% of the viewport height. Score = 0.6 × 0.25 = 0.15: poor on its own.

Shifts are grouped into session windows: bursts with less than 1 second between shifts, lasting at most 5 seconds. A page's CLS is the score of its worst window.

RatingCLS at the 75th percentile
Good≤ 0.1
Needs improvement0.1 to 0.25
Poor> 0.25

Common causes

  • Images and videos without width and height (or CSS aspect-ratio).
  • Ads, embeds and iframes that resize after loading.
  • Content injected above existing content: cookie banners, promos, "related articles".
  • Web fonts that swap and change text size (how to load fonts without layout shift).
  • Animations of layout properties such as top or height instead of transform.

Finding and fixing shifts

Chrome devtools' Performance panel highlights layout shifts and the elements involved. In the field, real user monitoring shows CLS per page and device, so you can see which templates are affected. For step-by-step fixes, read how to fix CLS.

Quick fixes by cause

CauseFix
Images without dimensionsAdd width and height attributes, or CSS aspect-ratio
Ads and embedsReserve space with a min-height container sized to the usual creative
Late banners and noticesOverlay them (fixed position) or reserve their space from the start
Web fonts swappingPreload the font, use size-adjust on the fallback, or font-display: optional
Layout animationsAnimate transform and opacity instead of top, left, width or height

Finding the shifting element

In the browser console, this logs each layout shift with the elements that moved, while you load and use the page:

javascript
new PerformanceObserver((list) => {
  for (const e of list.getEntries()) {
    if (e.hadRecentInput) continue;
    console.log(e.value.toFixed(4), e.sources?.map((s) => s.node));
  }
}).observe({ type: 'layout-shift', buffered: true });

Frequently asked questions

Do shifts caused by clicking count?

No. Shifts within 500 ms of a tap, click or key press are excluded, because the user expects the page to change.

Does scrolling cause CLS?

Scrolling itself does not. Content that loads and pushes things around while you scroll does.

  • What is FCP (First Contentful Paint)?: First Contentful Paint explained: what FCP measures, the 1.8 second threshold, how it differs from LCP and TTFB, and the render-blocking fixes that improve it.
  • What is Apdex?: Apdex explained: the formula, how to pick the threshold T, a worked example, how to read the score, and why many teams now prefer SLOs and percentiles.
  • What is TTFB (time to first byte)?: Time to first byte explained: what TTFB measures, the 0.8 second threshold, the phases that add up to it, how to measure it and how to cut it.
  • Monitoring dashboard best practices: Build monitoring dashboards people actually use: one question per board, a top-down layout, percentiles, deploy markers, template variables and TV mode tips.
  • On-call handover template: A free on-call handover template for engineering teams: open incidents, noisy alerts, risky changes and follow-ups, so every shift starts with full context.
  • Monitoring a cloud migration: Monitor a cloud migration safely: baseline performance before you move, compare old and new side by side, watch the cutover.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.