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
How it is calculated
When a visible element moves between frames without a user action, the browser records a layout shift with a score:
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 dimensionExample
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.
| Rating | CLS at the 75th percentile |
|---|---|
| Good | ≤ 0.1 |
| Needs improvement | 0.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.
| Cause | Fix |
|---|---|
| Images without dimensions | Add width and height attributes, or CSS aspect-ratio |
| Ads and embeds | Reserve space with a min-height container sized to the usual creative |
| Late banners and notices | Overlay them (fixed position) or reserve their space from the start |
| Web fonts swapping | Preload the font, use size-adjust on the fallback, or font-display: optional |
| Layout animations | Animate 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:
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 });Related reading
- 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.