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.
The Three Core Web Vitals
| Metric | Measures | Good | Poor |
|---|---|---|---|
| LCP | Loading performance — time until largest visible content renders | ≤ 2.5s | > 4s |
| INP | Responsiveness — slowest interaction response across page session | ≤ 200ms | > 500ms |
| CLS | Visual 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)
- Preload the LCP image —
<link rel="preload" as="image" href="/hero.webp" fetchpriority="high"> - Reduce TTFB — Use a CDN, enable caching headers, move server closer to users
- Avoid lazy-loading the LCP element — Set
loading="eager"andfetchpriority="high"on the hero image - Use modern image formats — Convert hero images to WebP/AVIF (40–80% smaller)
- Inline critical CSS — Unblock render by inlining above-the-fold styles
- Use HTTP/2 or HTTP/3 — Allows parallel asset loading
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
- PageSpeed Insights — pagespeed.web.dev — field + lab data per URL
- Google Search Console — Core Web Vitals report, URL groups, historical trends
- Chrome DevTools Performance panel — Record interactions, identify long tasks
- Lighthouse — Lab data audit with fix suggestions (see Lighthouse audit guide)
- web-vitals npm package — In-page measurement, send to your analytics
- CrUX API — Programmatic access to field data for any public URL
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.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
Web Performance Checklist
Interactive web performance checklist covering images, fonts, JavaScript, CSS, caching, and server. Check off items to track your score out of 100 and export as Markdown.
Open free tool →
Lighthouse Score Simulator
Estimate Lighthouse performance scores based on JS bundle size, CSS, images, TTFB, and render-blocking resources. Get LCP, FID, CLS, FCP estimates.
Open free tool →
Web Vitals Scorer
Check your Core Web Vitals scores. Enter LCP, INP, and CLS values to see instant Pass/Fail ratings with Good/Needs Improvement/Poor thresholds and optimization tips.
Open free tool →
More Free Tools
Related Articles
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.
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.
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.
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.
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.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →