Core Web Vitals and Performance Metrics

LCP, INP and CLS: what they measure, their thresholds, and how lab and field data differ.

Intermediate · about 3 hours · difficulty 3/5

Learn first: How Browsers Render a Page, The Event Loop

Performance is a feature: slow pages lose users, sales and search ranking. Google's Core Web Vitals give a shared vocabulary for the parts of speed users actually feel.

The three Core Web Vitals

  • Largest Contentful Paint (LCP): when the biggest visible element (usually a hero image or heading) finishes rendering. Good: 2.5 s or less. Common causes of slowness: slow server response, render-blocking CSS and JS, a lazy-loaded or unoptimised hero image.
  • Interaction to Next Paint (INP): how quickly the page visually responds to clicks, taps and key presses throughout the visit. Good: 200 ms or less. Caused by long JavaScript tasks blocking the main thread.
  • Cumulative Layout Shift (CLS): how much content jumps around unexpectedly. Good: 0.1 or less. Caused by images without dimensions, late-loading ads or embeds, and web fonts swapping.

Supporting metrics: TTFB (server response time) and FCP (first paint of any content).

Lab vs field data

  • Lab data (Lighthouse, DevTools) runs a controlled test on one machine. Great for debugging, but it is not your users.
  • Field data (real user monitoring, the Chrome UX Report shown in PageSpeed Insights, or the web-vitals library sending metrics to your analytics) reflects real devices and networks. Judge success by the 75th percentile of field data.

Budgets

Set a performance budget (for example LCP under 2.5 s on a mid-range phone on 4G, and under 200 KB of JavaScript for a landing page) and check it in CI so regressions are caught in review.

Good enough to move on

You can explain each vital, name its typical causes, read a PageSpeed Insights report and collect field metrics from your own app with the web-vitals library.

Key concepts

  • Largest Contentful Paint (LCP)
  • Interaction to Next Paint (INP)
  • Cumulative Layout Shift (CLS)
  • TTFB and FCP
  • Lab vs field data
  • web-vitals library and RUM
  • Performance budgets

Mini project

Add the web-vitals library to one of your deployed apps, log LCP, INP and CLS to the console or an analytics endpoint, and compare the numbers with a PageSpeed Insights run.

Check yourself

Your Lighthouse score is 98 but field INP is poor. How can both be true?

Free resources