Core Web Vitals Metrics
Core Web Vitals are a set of three metrics that measure loading performance, interactivity, and visual stability. Google uses these metrics as page experience signals for search ranking.Overview
Google measures Core Web Vitals at the 75th percentile — meaning 75% of page visits must meet “Good” thresholds for a page to pass.| Metric | Measures | Good | Needs Improvement | Poor |
|---|---|---|---|---|
| LCP | Loading | ≤ 2.5s | 2.5s – 4.0s | > 4.0s |
| INP | Interactivity | ≤ 200ms | 200ms – 500ms | > 500ms |
| CLS | Visual Stability | ≤ 0.1 | 0.1 – 0.25 | > 0.25 |
LCP: Largest Contentful Paint
What is LCP?
Largest Contentful Paint (LCP) measures when the largest content element in the viewport becomes visible. This is typically:- An
<img>element - An
<image>element inside<svg> - A
<video>element with poster image - An element with a background image via
url() - A block-level element containing text nodes
LCP Timeline
Common LCP Issues
1. Slow Server Response (TTFB > 800ms)
Target: < 800ms Solutions:- Use CDN for edge caching
- Implement stale-while-revalidate caching
- Optimize database queries
- Use edge functions for dynamic content
2. Render-Blocking Resources
3. Slow Resource Load Times
4. Client-Side Rendering Delays
LCP Optimization Checklist
- TTFB < 800ms (use CDN, edge caching)
- LCP image preloaded with fetchpriority=“high”
- LCP image optimized (WebP/AVIF, correct size)
- Critical CSS inlined (< 14KB)
- No render-blocking JavaScript in
<head> - Fonts don’t block text rendering (font-display: swap)
- LCP element in initial HTML (not JS-rendered)
Debugging LCP
Common LCP Issues and Impact
| Issue | Impact | Fix |
|---|---|---|
| No preload for LCP image | +500-1000ms | Add <link rel="preload"> |
| Large unoptimized image | +300-800ms | Compress, use WebP/AVIF |
| Render-blocking CSS | +200-500ms | Inline critical CSS |
| Slow TTFB | +300-2000ms | CDN, edge caching |
| Client-rendered content | +500-2000ms | SSR/SSG |
INP: Interaction to Next Paint
What is INP?
INP measures responsiveness across ALL interactions (clicks, taps, key presses) during a page visit. It reports the worst interaction (at 98th percentile for high-traffic pages).INP Breakdown
Total INP = Input Delay + Processing Time + Presentation Delay| Phase | Target | Optimization |
|---|---|---|
| Input Delay | < 50ms | Reduce main thread blocking |
| Processing | < 100ms | Optimize event handlers |
| Presentation | < 50ms | Minimize rendering work |
Common INP Issues
1. Long Tasks Blocking Main Thread
2. Heavy Event Handlers
3. Third-Party Scripts
4. Excessive Re-renders (React/Vue)
INP Optimization Checklist
- No tasks > 50ms on main thread
- Event handlers complete quickly (< 100ms)
- Visual feedback provided immediately
- Heavy work deferred with requestIdleCallback
- Third-party scripts don’t block interactions
- Debounced input handlers where appropriate
- Web Workers for CPU-intensive operations
Debugging INP
CLS: Cumulative Layout Shift
What is CLS?
CLS measures unexpected layout shifts. A shift occurs when a visible element changes position between frames without user interaction. CLS Formula:impact fraction × distance fraction
Common CLS Causes
1. Images Without Dimensions
2. Ads, Embeds, and Iframes
3. Web Fonts Causing FOUT
4. Animations Triggering Layout
CLS Optimization Checklist
- All images have width/height or aspect-ratio
- All videos/embeds have reserved space
- Ads have min-height containers
- Fonts use font-display: optional or matched metrics
- Dynamic content inserted below viewport
- Animations use transform/opacity only
- No content injected above existing content
Debugging CLS
Measurement Tools
Lab Testing (Synthetic)
- Chrome DevTools → Performance panel, Lighthouse tab
- WebPageTest → Detailed waterfall, filmstrip view
- Lighthouse CLI →
npx lighthouse <url>
Field Data (Real Users)
- Chrome User Experience Report (CrUX) → BigQuery or API
- Google Search Console → Core Web Vitals report
- web-vitals library → Send to your analytics