Core Web Vitals: measure and improve LCP, INP, and CLS
See how fast your website is for real visitors, then fix the slowest metric first.
The Web Vitals page breaks each metric down by page, device, browser and location, with percentiles from p50 to p99. It also collects FCP, TTFB and FPS, which help diagnose but aren't Core Web Vitals.
Read the scores
Judge the 75th percentile, separately for mobile and desktop; a fast average can hide many slow visits. See Google's Web Vitals guidance.
In single-page apps, browsers measure page changes differently:
Compare a page's numbers within one browser family, not across them.
Fix a slow LCP
<img
src="/product-preview.webp"
alt="Product dashboard showing traffic and conversions"
width="1200"
height="800"
fetchpriority="high"
/>Put the main image in the initial HTML, size and compress it for each viewport, and don't lazy-load it. Give only that image high priority. Use a performance trace to find slow responses and render-blocking work. See Optimize LCP.
Fix a slow INP
Reproduce the slow interaction itself, not just page load. Do less in event handlers, break up long tasks, and load optional features when they're needed. An async script still costs time when it runs. See Optimize INP.
Fix layout shifts
Set dimensions or an aspect ratio on images, video and embeds. Reserve space for ads and content that loads later, and don't insert content above what someone is reading. CLS counts the largest burst of shifts, with gaps under a second, lasting at most five seconds. See Google's CLS definition.
To log metrics while debugging, use the web-vitals library. Databuddy already collects them, so don't send them twice:
import { onCLS, onINP, onLCP } from "web-vitals";
const log = ({ name, value }) => console.log(name, value);
onCLS(log);
onINP(log);
onLCP(log);Check that a fix worked
Compare equal periods and the same device group before and after the change, using the previous-period view. Traffic mix and content changes can move numbers too. Use PageSpeed Insights and Lighthouse CI to catch regressions between releases. Google uses Core Web Vitals in ranking, but good scores don't guarantee rankings (page experience).
Related
How is this guide?