Skip to content
Merouane Mousselmal

Search

0 results

Type to search

WebConcepts

WebConcepts

Core Web Vitals explained: LCP, INP and CLS

A plain explanation of the three Core Web Vitals, what counts as good, how each one is measured, and the first fixes to try for slow, laggy or jumpy pages.

By Merouane MousselmalPublished 4 min read
On this page

Slow pages, laggy buttons and layouts that jump around are easy to feel and hard to talk about. Core Web Vitals turn those feelings into three numbers: how fast the main content appears, how quickly the page reacts, and how stable the layout stays.

The three metrics

MetricWhat it measuresGoodNeeds improvementPoor
LCP (Largest Contentful Paint)Loading: when the largest visible element is rendered2.5 s or less2.5 to 4.0 sover 4.0 s
INP (Interaction to Next Paint)Responsiveness: how long the page takes to react to input200 ms or less200 to 500 msover 500 ms
CLS (Cumulative Layout Shift)Visual stability: unexpected movement of content0.1 or less0.1 to 0.25over 0.25

A page passes a metric when it reaches the good value for at least 75% of real visits, measured separately for mobile and desktop. INP replaced First Input Delay as a Core Web Vital in March 2024.

LCP: when does the main content appear?

The largest element is usually a hero image, a heading or a big block of text. Three things mostly decide the result: how quickly the server responds, how heavy the element is, and whether something blocks rendering.

  • Do not lazy-load the image that is likely to be the largest element. Load it eagerly, and consider preloading it with a high fetch priority.
  • Compress images and serve them at the size they are displayed.
  • A slow server makes a good LCP almost impossible, so check the time to first byte before you optimize images.

INP: how quickly does the page react?

INP watches every click, tap and key press during a visit and reports roughly the slowest response, measured from the input to the next visual update.

  • Break long JavaScript tasks into smaller pieces, so the browser can respond between them
  • Do less work inside event handlers, and postpone anything that is not urgent
  • Avoid re-rendering large parts of the page for a small change
  • Test pages that people interact with, such as forms and search results, and not only the home page

CLS: does the layout jump?

CLS adds up unexpected layout shifts. It is based on the largest burst of shifts, not on the total. Shifts that happen right after a user action, such as opening a menu, do not count. A banner that inserts itself after two seconds does.

  • Give images and videos a width and height, or an aspect ratio, so the browser reserves space
  • Reserve space for content that arrives late, such as embeds, ads and consent banners
  • Do not insert new content above content the reader is already looking at

Measuring them

Real-user data is available in the Chrome User Experience Report, in the Core Web Vitals report of Google Search Console, and in PageSpeed Insights. To collect the numbers from your own visitors, use the web-vitals library:

import { onCLS, onINP, onLCP } from "web-vitals";
 
onCLS(console.log);
onINP(console.log);
onLCP(console.log);

In production, send each metric to your analytics instead of logging it. Chrome DevTools also flags LCP, INP and layout shifts in its Performance panel.

Do they affect search ranking?

Google describes good Core Web Vitals as aligned with what its ranking systems try to reward. That is not a promise of better rankings, and relevant content still matters most. The real benefit is a page that feels fast to the people using it.

Takeaway

Remember the three numbers: LCP under 2.5 seconds, INP under 200 milliseconds and CLS under 0.1. Measure with real-user data, fix the metric that fails, and measure again.

Comments

Comments are optional. Loading them connects your browser to Giscus and GitHub. Read the privacy details.

Get new notes by email

Which topics do you want?

This site uses Google Analytics to count visits and see which articles are read. It only runs if you accept. Read the privacy page.