Skip to main content

Core Web Vitals Guide 2026

Core Web Vitals are Google's three essential user-experience metrics: LCP, INP, and CLS. Passing all three is required for the Page Experience ranking signal and correlates directly with user retention and conversion rates.

✓ LCP / INP / CLS explained ✓ Field vs lab data ✓ Fix guides per metric ✓ Measurement tools

The Three Core Web Vitals

Metric Measures Good Poor
LCPLoading performance — time until largest visible content renders≤ 2.5s> 4s
INPResponsiveness — slowest interaction response across page session≤ 200ms> 500ms
CLSVisual stability — unexpected layout shifts during page lifetime≤ 0.1> 0.25

Measuring Core Web Vitals

# Install web-vitals library
npm install web-vitals

# Measure and send to analytics
import { onLCP, onINP, onCLS, onFCP, onTTFB } from 'web-vitals';

function sendToAnalytics({ name, value, rating, id }) {
  // Send to your analytics endpoint
  navigator.sendBeacon('/analytics', JSON.stringify({
    metric: name,
    value: Math.round(name === 'CLS' ? value * 1000 : value),
    rating,   // 'good' | 'needs-improvement' | 'poor'
    id,
  }));
}

onLCP(sendToAnalytics);
onINP(sendToAnalytics);
onCLS(sendToAnalytics);
onFCP(sendToAnalytics);
onTTFB(sendToAnalytics);

Fixing LCP (Largest Contentful Paint)

Fixing INP (Interaction to Next Paint)

// Break up long tasks with scheduler
async function processLargeList(items) {
  const CHUNK_SIZE = 100;
  for (let i = 0; i < items.length; i += CHUNK_SIZE) {
    const chunk = items.slice(i, i + CHUNK_SIZE);
    processChunk(chunk);
    // Yield to browser between chunks
    await scheduler.yield();
  }
}

// Use isInputPending to avoid blocking interactions
function runWithYielding(tasks) {
  return new Promise(resolve => {
    function runTask() {
      while (tasks.length > 0) {
        if (navigator.scheduling?.isInputPending()) {
          // Yield to user input
          setTimeout(runTask, 0);
          return;
        }
        tasks.shift()();
      }
      resolve();
    }
    runTask();
  });
}

Fixing CLS (Cumulative Layout Shift)

<!-- Always include width + height on images -->
<img src="hero.webp" width="1200" height="600" alt="Hero" loading="eager">

<!-- CSS aspect-ratio for responsive media -->
<style>
.video-container {
  aspect-ratio: 16 / 9;
  width: 100%;
}
.ad-slot {
  min-height: 250px; /* Reserve space for late-loading ads */
}
</style>

<!-- Font-display to prevent FOUT layout shift -->
<style>
@font-face {
  font-family: 'MyFont';
  src: url('font.woff2') format('woff2');
  font-display: optional; /* Skip FOUT entirely */
  /* Or use 'swap' with size-adjust to reduce shift: */
  /* font-display: swap; size-adjust: 98%; */
}
</style>

Tools for Measuring Core Web Vitals

Frequently Asked Questions

What are Core Web Vitals and why do they matter for SEO?▼

Core Web Vitals are three user-experience metrics Google uses in its Page Experience ranking signal: LCP (Largest Contentful Paint) measures loading speed, INP (Interaction to Next Paint) measures responsiveness, and CLS (Cumulative Layout Shift) measures visual stability. Pages that pass all three thresholds get a small ranking boost. More importantly, improving these metrics improves real user experience, which correlates with lower bounce rates and higher conversions.

How do I measure Core Web Vitals in production (real users)?▼

Use the Chrome User Experience Report (CrUX) for real-field data: search your domain on PageSpeed Insights (pagespeed.web.dev) or use the CrUX API. Install the `web-vitals` npm package to capture metrics in your analytics. Google Search Console's Core Web Vitals report shows URL-level field data. Field data reflects real users on real devices — it often differs significantly from lab (Lighthouse) data due to user device variance, cold starts, and network conditions.

What is the difference between LCP lab data and field data?▼

Lab data (Lighthouse, PageSpeed Insights) measures LCP in a controlled simulated environment with a specific device profile and 4G throttling. Field data (CrUX) aggregates real user measurements from Chrome browsers. They often differ because: real users have faster or slower connections, some users have the page cached, mobile device CPU varies widely, and different users navigate to different entry points. Optimize for field data thresholds — lab data is for debugging, not for CrUX status.

How do I fix Cumulative Layout Shift (CLS)?▼

The most common CLS causes are: images/videos without explicit width/height attributes (browser doesn't reserve space), dynamically injected content above existing content (ads, banners, cookie notices), web fonts causing FOIT/FOUT (text reflow), and iframes without aspect ratio containers. Fix by always setting width/height on media elements, reserving space for dynamic content with min-height, using `font-display: optional` or `size-adjust` for fonts, and using CSS aspect-ratio for embeds.

What replaced FID (First Input Delay) in Core Web Vitals?▼

Google replaced First Input Delay (FID) with INP (Interaction to Next Paint) in March 2024. FID measured only the delay before the browser could start processing the first interaction. INP measures the full duration of the slowest interaction (input delay + processing time + presentation delay) across the entire page session. INP is a stricter, more comprehensive measure of responsiveness. The good threshold for INP is ≤ 200ms, needs improvement 200–500ms, poor > 500ms.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Apr 2, 2026 · 23 min read

Web Performance and Core Web Vitals 2026: Complete Optimization Guide

Complete guide to Core Web Vitals optimization in 2026. Covers LCP, INP, CLS, TTFB optimization with real code examples. Includes Next.js, React, Vite, Cloudflare Workers, and backend optimization strategies for achieving 90+ Lighthouse scores.

Mar 28, 2026 · 14 min read

Web Performance 2026: INP, Core Web Vitals & Lighthouse CI

Master web performance in 2026: INP replacing FID, LCP and CLS optimization, Lighthouse CI in GitHub Actions, RUM with web-vitals.js, and setting performance budgets to keep your site fast.

Mar 21, 2026 · 14 min read

Web Performance Optimization: Improve Your Core Web Vitals in 15 Steps

15 actionable web performance optimization techniques to improve LCP, CLS, and INP (Core Web Vitals). Real code examples, measurement tools, and before/after results.

Apr 2, 2026 · 25 min read

Performance Optimization 2026: Complete Guide to Frontend, Backend, and Infrastructure

Comprehensive performance optimization guide for 2026 covering Core Web Vitals, JavaScript bundle optimization, server-side rendering, caching strategies, database query optimization, CDN configuration, and real-world benchmarks.

Apr 2, 2026 · 13 min read

Performance Testing in 2026: Beyond Page Load Times

A practical guide to performance testing in 2026 — Core Web Vitals, load testing, stress testing, soak testing, and building a performance culture that treats speed as a feature. Includes tooling recommendations and actionable measurement strategies.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →