The three Core Web Vitals are LCP (loading: when the largest content element renders), INP (responsiveness: how long interactions take to produce the next frame) and CLS (visual stability: how much content unexpectedly shifts). A page "passes" when the 75th percentile of real-user visits is LCP ≤ 2.5 s, INP ≤ 200 ms and CLS ≤ 0.1, evaluated separately for mobile and desktop. INP replaced FID as a Core Web Vital on 12 March 2024.
| Metric | Measures | Good | Needs improvement | Poor |
|---|---|---|---|---|
| LCP – Largest Contentful Paint | Render time of the largest image, video poster or text block in the viewport | ≤ 2.5 s | ≤ 4 s | > 4 s |
| INP – Interaction to Next Paint | Latency from a click, tap or key press to the next paint, roughly the worst interaction of the visit | ≤ 200 ms | ≤ 500 ms | > 500 ms |
| CLS – Cumulative Layout Shift | Largest "session window" of unexpected layout shifts | ≤ 0.1 | ≤ 0.25 | > 0.25 |
FID only measured the input delay of the first interaction: the time until the handler could start. It ignored the time spent in the handler and the time to paint, and it ignored every later interaction. Almost every site passed FID, while users still saw sluggish menus and filters. INP looks at all clicks, taps and key presses during the visit and reports a value near the worst one (for pages with many interactions, one outlier per 50 interactions is ignored). Each interaction's latency is input delay + processing time + presentation delay.
Early CLS summed every shift over the whole page lifetime, which unfairly punished long-lived SPAs. Since 2021, shifts are grouped into session windows: a window ends after a 1 s gap with no shifts or after 5 s in total, and CLS is the largest window's score. Shifts within 500 ms of user input are excluded, because users expect content to move when they click "expand".
web-vitals library. This is what Google uses and what users experience.import { onLCP, onINP, onCLS } from 'web-vitals/attribution';
function send(metric) {
navigator.sendBeacon('/rum', JSON.stringify({
name: metric.name,
value: metric.value,
rating: metric.rating,
attribution: metric.attribution, // e.g. LCP element, slow INP target
}));
}
onLCP(send); onINP(send); onCLS(send);
web-vitals/attribution to find which element or interaction is slow.Spotted a mistake or a rights concern? Report an issue