Start a project

Tool 93 of 194 · Performance

Layout Shift (CLS) Simulator

Describe what happens after the first paint, such as an image loading or a banner appearing, and see each layout shift scored, the CLS total and the fix.

Layout Shift (CLS) Simulator at a glanceIllustration: 1, Page + events; 2, processed in your browser; 3, CLS score.Layout Shift (CLS) Simulator</>1Page + events2.5 s3CLS score2In yourbrowser
1 Page + events 2 processed on your device 3 CLS score

Layout Shift (CLS) Simulator

Your page

Formats: 600ms load img.hero 1200x675 · 900ms insert before main: <div>...</div> (before, after, prepend or append) · 1.4s style body: font-family: Georgia · 2s remove .ad · 2.6s input (a tap or key press)

    Page after the events

    Red boxes show the region the last counted shift moved. Scripts and remote images don't load; images are drawn as striped boxes when they load.

    Score per event

    Every event

    TimeEventImpact × distanceScoreMoved

    01

    What it does

    Renders a page, applies late-loading images, inserted banners, font swaps and removals, and scores each shift as Chrome does.

    • Events: images loading, content inserted, style changes such as font swaps, removals and user input
    • Impact fraction and distance fraction measured in a real browser layout
    • Shifts within 500 ms of input excluded, as the Layout Instability API does
    • Session windows: gaps under 1 s, at most 5 s long, the worst one is CLS

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Each shift's impact, distance and score, session windows, the CLS rating and fixes, with a Copy and a Download button on every result.

    • Performance
    • CLS
    • Core Web Vitals
    • Layout shift

    Why it matters

    Cumulative Layout Shift is the Core Web Vital people find hardest to reason about: the score isn't how far things moved, but the share of the screen that moved multiplied by the furthest distance anything moved, added up within session windows. A 1200-pixel image that loads without dimensions near the top can cost more than a dozen small shifts below the fold, and a cookie banner inserted above the content moves everything on screen at once.

    This simulator renders your page in a sandboxed frame and then plays a timeline you write: an image finishing loading, a banner inserted before the main content, the web font swapping in, an ad slot removed, a user tap. After each event it measures every element's position in the real browser layout, takes the union of the moved areas inside the viewport as the impact fraction and the largest move as the distance fraction, and multiplies them, exactly as the Layout Instability spec scores a shift. Shifts within half a second of input don't count, shifts are grouped into session windows, and the worst window is your CLS, rated against Google's 0.1 and 0.25 thresholds. Turn on the fixes to see the score with image dimensions reserved and inserted content shown as an overlay.

    How it works

    1. InputThe HTML, CSS and what loads after first paint
    2. In your browserReplayed in a frame; every shift measured as the browser does
    3. OutputCLS, the worst session window and the fix for each shift

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Finding which late image, banner or font swap is hurting CLS.

    By the numbers

    Layout shift score of each event in the sample product page, phone 390×7000.6 s: load img.hero 1200x675: 0.1808; 0.9 s: insert before main: <div class="cookie: 0.0735; 1.4 s: style body: font-family: Georgia, seri: 0.0002; 2.6 s: input: 0; 2.8 s: insert append .faq: <p>8 to 10 weeks, : excluded; 3.2 s: load img.thumb 400x300: 0goodpoor0.6 s: load img.hero 1200x6750.18080.9 s: insert before main: <div class="cookie0.07351.4 s: style body: font-family: Georgia, seri0.00022.6 s: input02.8 s: insert append .faq: <p>8 to 10 weeks, excluded3.2 s: load img.thumb 400x3000
    Found by this tool in its sample: CLS 0.254 (poor) at 390×700. 2 shifts counted, worst session window 0.6–1.4 s. A hero image with no width and height makes most of it; a cookie banner inserted above the content adds the rest. Each shift scores impact fraction × distance fraction; CLS is the worst session window (gaps under 1 s, 5 s max), and shifts within 500 ms of input don't count. With the fixes on, it drops to 0. Source: web.dev: Cumulative Layout Shift (CLS); W3C: Layout Instability API.
    Show the numbers as a table
    TimeEventImpact × distanceScoreMoved
    0.6 sload img.hero 1200x67571.4% × 25.3%0.1808h1 ↓177px, p.lead ↓177px, img.thumb ↓177px, details.faq ↓177px, p ↓177px
    0.9 sinsert before main: <div class="cookie">We use cookies to run the bas…91.9% × 8.0%0.0735main ↓56px
    1.4 sstyle body: font-family: Georgia, serif0.5% × 4.0%0.0002button ←28px
    2.6 sinputNo shift0—
    2.8 sinsert append .faq: <p>8 to 10 weeks, then a delivery slot of your ch…Within 500 ms of input: not counted0—
    3.2 sload img.thumb 400x300No shift0—

    How to use it

    1. Paste the page's HTML and CSS.
    2. Describe what happens after the first paint, one event per line.
    3. Read each shift's score and the fix.
    4. Apply the fixes and compare.

    FAQ

    How is a layout shift scored?

    Impact fraction times distance fraction. Impact is the share of the viewport covered by moved elements, before and after the move. Distance is the furthest any element moved, divided by the viewport's larger side.

    What's a good CLS?

    0.1 or less is good, up to 0.25 needs improvement, and above that is poor, measured at the 75th percentile of real visits.

    What are session windows?

    Shifts less than a second apart are grouped, up to five seconds per group. CLS is the largest group's total, so a long page visit isn't punished for scattered small shifts.

    Why don't some shifts count?

    Shifts within 500 ms of a tap, click or key press are expected responses to the user, so they're excluded.

    Are the scores the same as Chrome's?

    They use the same formula on a real layout, but only for the elements and events you describe. Real pages also shift from late CSS, ads and scripts; check field data in Search Console or CrUX.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk