How is it 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 rates a score at or under 0.1 as good and over 0.25 as poor.
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.