Core Web Vitals: Measure and Improve Web Performance

Web2026-10-13TryQuickToolBox

Your users are impatient. If your site takes more than a few seconds to load, they leave. Search engines notice too: Core Web Vitals are ranking signals. But improving them feels like a maze of metrics and tools. This guide cuts through the noise. You'll learn what each metric means, how to measure it accurately, and concrete steps to improve it.

What Are Core Web Vitals?

Core Web Vitals are three metrics that quantify real-world user experience:

These metrics are measured from real user sessions (field data) and synthetic tests (lab data). Field data is what matters for ranking.

How to Measure Core Web Vitals

You need both lab and field data. Lab data helps you debug; field data reflects actual user experience.

Lab Tools

Field Tools

To collect field data, add the web-vitals library to your site:

import {onLCP, onINP, onCLS} from 'web-vitals';

function sendToAnalytics(metric) {
  const body = JSON.stringify(metric);
  navigator.sendBeacon('/analytics', body);
}

onLCP(sendToAnalytics);
onINP(sendToAnalytics);
onCLS(sendToAnalytics);

This gives you a continuous stream of real-user metrics.

Improving LCP

LCP is usually the largest image, video, or block of text. To improve it, focus on the critical path.

  1. Optimize images: Compress images, use modern formats like WebP or AVIF, and set explicit width and height. Tools like the Image Compressor can help reduce file size without visible quality loss.
  2. Preload the LCP resource: Add <link rel="preload"> for the hero image or font.
  3. Reduce server response time: Use a CDN, enable caching, and optimize backend queries.
  4. Eliminate render-blocking resources: Inline critical CSS, defer non-critical JavaScript.
  5. Use responsive images: Serve appropriately sized images with srcset.

Example of preloading an LCP image:

<link rel="preload" as="image" href="/hero.webp" fetchpriority="high">

Improving INP

INP measures responsiveness. Long tasks block the main thread, delaying visual feedback.

Example of yielding to the main thread:

async function yieldToMain() {
  if ('scheduler' in window && 'yield' in scheduler) {
    await scheduler.yield();
  } else {
    await new Promise(resolve => setTimeout(resolve, 0));
  }
}

Improving CLS

CLS happens when elements shift unexpectedly. Common causes: images without dimensions, ads, embeds, and dynamically injected content.

Example of reserving space for an image:

<img src="#" width="800" height="600" alt="...">

Tools and Workflow

Integrate performance checks into your development workflow:

Comparison of Metrics and Targets

MetricWhat it measuresGood target
LCPLoading performance< 2.5 s
INPResponsiveness< 200 ms
CLSVisual stability< 0.1

FAQ

What are Core Web Vitals?

Core Web Vitals are three metrics—LCP, INP, and CLS—that measure loading, interactivity, and visual stability. They are used by Google as ranking signals.

How do I measure Core Web Vitals?

Use lab tools like Lighthouse for debugging and field tools like the web-vitals library or CrUX for real-user data. Both are important.

What is a good LCP score?

A good LCP is under 2.5 seconds. Anything above 4 seconds is poor. Optimize images, preload critical resources, and reduce server response time.

Ready to speed up your site? Start by compressing your images with our free Image Compressor to instantly improve LCP.