# Cumulative Layout Shift (CLS)

Also called: CLS, layout shift

Cumulative Layout Shift measures how much visible content moves around unexpectedly while a page is open. It is a unitless score: the higher it is, the more things jumped under the visitor's eyes or finger.

## How it is calculated

Each unexpected shift gets a score from how much of the viewport moved and how far. Shifts less than one second apart are grouped into a session window, capped at five seconds. CLS is the score of the largest window. Shifts shortly after a visitor's input are not counted.

[Google's CLS guide](https://web.dev/articles/cls) rates a score at or under 0.1 as good and over 0.25 as poor.

```
CLS = largest session window of (impact fraction × distance fraction)
```

## Example

An article loads, then an ad slot without reserved space appears above the text and pushes it down by a quarter of the screen. Most of the viewport moved, so that one shift scores around 0.2, twice the good threshold. Reserving a fixed height for the slot removes the shift and brings CLS close to zero.

## Common mistakes

- Images and embeds without dimensions. Give them width and height, or an aspect ratio, so space is reserved.
- Banners inserted at the top after load. They push everything down.
- Reading CLS as a time. It is a score with no unit.

## How CrispStats shows it

CrispStats records CLS on real visits with the `data-vitals` attribute, as the worst session window with input-driven shifts ignored. It is shown at the 75th percentile, rated against 0.1 and 0.25, and listed by page so you can find the template that jumps.

## Related terms

- [Core Web Vitals](/glossary/core-web-vitals)
- [Largest Contentful Paint (LCP)](/glossary/lcp)
- [Interaction to Next Paint (INP)](/glossary/inp)
