Core Web Vitals are three measurements Google uses to describe how a page feels to a real visitor: how quickly the main content appears, how quickly the page responds to input, and whether things jump around while it loads. Google uses them in its ranking systems as part of page experience, but the stronger reason to care is simpler. Slow, jumpy pages lose visitors.
This guide covers what each metric measures, how to find out what is dragging it down, and the fixes that make the biggest difference.
The three metrics and their thresholds
| Metric | What it measures | Good | Poor |
|---|---|---|---|
| LCP (Largest Contentful Paint) | When the largest image or text block in the viewport finishes rendering | 2.5 s or less | Over 4 s |
| INP (Interaction to Next Paint) | How long the page takes to visibly respond to clicks, taps and key presses | 200 ms or less | Over 500 ms |
| CLS (Cumulative Layout Shift) | How much visible content moves unexpectedly | 0.1 or less | Over 0.25 |
A page passes when it meets the "good" threshold for at least 75 percent of real page loads, measured separately on mobile and desktop.
INP replaced First Input Delay (FID) as a Core Web Vital in March 2024. FID only measured the delay before the first interaction started being processed. INP looks at the full response time of interactions throughout the whole visit, which makes it a much harder test.
Start with field data
There are two kinds of measurement, and they often disagree.
Lab data comes from tools like Lighthouse, run on one device with one network profile. It is repeatable and ideal for debugging.
Field data comes from real visitors on real devices. Google collects it in the Chrome User Experience Report (CrUX) and shows it in PageSpeed Insights and in the Core Web Vitals report in Search Console. This is the data Google actually uses.
A page can score 98 in Lighthouse on a fast laptop and still fail in the field, because most of its visitors are on mid-range Android phones. Use field data to see which metric fails and on which pages, then use lab tools to work out why.
To collect your own field data, the web-vitals library needs only a few lines:
import { onCLS, onINP, onLCP } from 'web-vitals';
function send(metric) {
const body = JSON.stringify({
name: metric.name,
value: metric.value,
rating: metric.rating,
page: location.pathname,
});
navigator.sendBeacon('/analytics/vitals', body);
}
onCLS(send);
onINP(send);
onLCP(send);
Its attribution build, web-vitals/attribution, also reports which element or interaction caused a poor score, which saves a lot of guesswork.
Fixing LCP
The LCP element is usually an image: a hero banner, a product photo or a large heading. It helps to split LCP into four parts and see which one is large:
- Time to first byte: how long the server takes to start responding.
- Resource load delay: the gap between that first byte and the moment the browser starts downloading the LCP image.
- Resource load duration: how long the image itself takes to download.
- Element render delay: the time between the image arriving and it appearing on screen.
The fixes map onto those parts:
- Never lazy load the LCP image.
loading="lazy"on a hero image is one of the most common causes of poor LCP. Lazy loading is for images below the fold. - Tell the browser it matters.
fetchpriority="high"on the LCP image moves it ahead of less important downloads. - Make it discoverable early. If the image is set in CSS or injected by JavaScript, the browser cannot find it until those files have loaded. Use a normal
<img>tag in the HTML, or a<link rel="preload">in the head. - Send fewer bytes. Serve AVIF or WebP, size images for the screen with
srcsetandsizes, and compress them properly. A 2,400 pixel wide hero image on a 400 pixel wide phone screen is wasted time. - Cut server response time. Cache rendered pages or generate them statically where the content allows, and serve them from a CDN close to your visitors.
- Do not render the main content only in the browser. If the hero text appears only after a large JavaScript bundle has downloaded and run, LCP waits for all of it. Server rendering fixes this.
<img
src="/images/hero-1200.avif"
srcset="/images/hero-600.avif 600w, /images/hero-1200.avif 1200w"
sizes="100vw"
width="1200"
height="600"
fetchpriority="high"
alt="Dashboard showing weekly delivery metrics"
/>
Fixing INP
INP is about the main thread. When a visitor taps a button, the browser has to run your event handlers and then paint the result. If the main thread is busy with other JavaScript, the tap has to wait.
Any task that keeps the main thread busy for more than 50 ms is a long task, and long tasks are what make a page feel sluggish. The fixes come down to doing less work, or breaking it into smaller pieces:
- Ship less JavaScript. Remove unused dependencies, split bundles by route, and load third-party widgets only on the pages that need them. Chat widgets, tag managers and A/B testing scripts are frequent offenders.
- Update the screen first, then do the rest. If a click opens a menu and also sends an analytics event, open the menu straight away and send the event afterwards.
- Avoid layout thrashing. Reading a layout property such as
offsetHeightright after changing styles forces the browser to recalculate layout on the spot. Batch your reads, then your writes. - In React, keep urgent updates small.
useTransitionmarks expensive re-renders as non-urgent, so typing and clicking stay responsive while they finish.
When you have to process a lot of data on the main thread, give the browser a chance to handle input between chunks:
async function processInChunks(items, handle) {
for (let i = 0; i < items.length; i++) {
handle(items[i]);
if (i % 50 === 0) {
await new Promise((resolve) => setTimeout(resolve, 0));
}
}
}
In browsers that support it, scheduler.yield() does the same job with better scheduling, and you can fall back to the setTimeout version elsewhere.
Fixing CLS
Layout shifts happen when something appears or changes size after the content around it has already been placed. The fixes are mostly about reserving space in advance:
- Always give images and videos dimensions. With
widthandheightattributes, or a CSSaspect-ratio, the browser reserves the right amount of space before the file arrives. - Reserve space for anything injected later, such as ads, embeds, cookie banners and "recommended for you" blocks. Give the container a minimum height that matches what will load into it.
- Do not insert content above what the visitor is reading, unless it is a direct response to something they did. Shifts within 500 ms of a click or key press do not count against CLS.
- Tame web font swaps. When the fallback font is replaced by the web font, text can reflow. Preload key fonts and use a fallback with adjusted metrics (
size-adjust,ascent-override) so the swap barely moves anything. Next.js does this automatically for fonts loaded throughnext/font. - Animate with
transform, not withtop,left,widthorheight. Transforms do not trigger layout and are not counted as layout shifts.
Keep the numbers from drifting back
Core Web Vitals tend to get worse slowly, one new script or unoptimised image at a time. A few habits keep them in check:
- Track field data continuously, not only when someone complains.
- Set a performance budget, such as a maximum JavaScript size per route, and check it in CI.
- Run Lighthouse against key pages in your pull request pipeline, so regressions are caught before they ship.
- Review third-party scripts regularly. Each one should earn its place.
Keep in mind that CrUX reports a rolling 28-day window, so an improvement can take up to four weeks to show fully in Search Console. Your own field data will confirm the fix worked long before that.
How we apply this on our own site
This website follows the same checklist. Its fonts are self-hosted and load with font-display set to swap, so text appears immediately without waiting on a third-party font server, and every public page is prerendered and served from a CDN instead of being rendered on each request. If your site is failing Core Web Vitals, fixing it is a standard part of our website development and support and optimization work.



