Core Web Vitals: Measure and Improve for Better Web Performance
Your users are impatient. If your page takes too long to load or jumps around as they try to read, they leave. Google knows this, and its ranking algorithm uses Core Web Vitals to measure real-world user experience. But beyond SEO, Core Web Vitals directly impact conversion rates and user satisfaction. In this guide, we’ll break down what each metric means, how to measure them accurately, and—most importantly—how to improve them with practical, code-level fixes.
What Are Core Web Vitals?
Core Web Vitals are a set of three metrics that quantify key aspects of user experience: loading, interactivity, and visual stability. They are part of Google’s Page Experience signals.
- Largest Contentful Paint (LCP): Measures loading performance. It marks the time when the largest content element (image, video, or text block) becomes visible. Aim for LCP under 2.5 seconds.
- Interaction to Next Paint (INP): Measures responsiveness. It captures the latency of all interactions (clicks, taps, key presses) and reports the longest one. Aim for INP under 200 milliseconds.
- Cumulative Layout Shift (CLS): Measures visual stability. It quantifies unexpected layout shifts during page load. Aim for CLS under 0.1.
These thresholds are based on field data from real users, not lab tests. That’s why measuring correctly is crucial.
How to Measure Core Web Vitals
You need both lab and field data. Lab tools help you debug; field data reflects real user experience.
Field Tools (Real User Monitoring)
- Chrome User Experience Report (CrUX): Google’s public dataset of real-user metrics. View it in PageSpeed Insights or Search Console.
- PageSpeed Insights: Shows both lab (Lighthouse) and field (CrUX) data for a URL.
- Search Console Core Web Vitals report: Groups URLs by status and metric.
- Web Vitals JavaScript library: Collect your own field data via the
web-vitalslibrary and send to your analytics.
Lab Tools (Synthetic Testing)
- Lighthouse: Built into Chrome DevTools. Provides lab metrics and opportunities.
- WebPageTest: Advanced testing with filmstrips and waterfall charts.
- Chrome DevTools Performance panel: Deep dive into runtime performance.
Start with PageSpeed Insights to get a quick overview, then use DevTools for debugging specific issues.
Improving LCP: Make the Main Content Load Faster
LCP is often the most impactful metric to fix. Common causes of poor LCP include slow server response, render-blocking resources, and unoptimized images.
- Optimize images: Compress images, use modern formats like WebP or AVIF, and serve responsive images with
srcset. Tools like Image Compressor can help reduce file size without visible quality loss. - Preload the LCP image: Add
<link rel="preload">for the hero image to start loading it earlier. - Reduce server response time: Use a CDN, enable caching, and optimize backend queries. For Nginx, consider fastcgi_cache or proxy_cache.
- Eliminate render-blocking resources: Inline critical CSS, defer non-critical CSS and JavaScript.
- Use a content delivery network (CDN): Serve assets from locations closer to users.
<!-- Preload LCP image -->
<link rel="preload" as="image" href="/hero.webp" fetchpriority="high">
<!-- Responsive images -->
<img src="#" srcset="hero-480.webp 480w, hero-800.webp 800w" sizes="(max-width: 600px) 480px, 800px" alt="Hero">
Improving INP: Make Interactions Feel Instant
INP replaced First Input Delay (FID) in March 2024. It measures the full duration of interactions, not just the delay before processing. To improve INP, you need to reduce JavaScript execution time and avoid long tasks.
- Break up long tasks: Use
setTimeoutorrequestIdleCallbackto yield to the main thread. - Optimize event handlers: Debounce or throttle expensive handlers, and avoid layout thrashing.
- Reduce JavaScript bundle size: Code-split, tree-shake, and lazy-load non-critical scripts.
- Use web workers: Move heavy computations off the main thread.
- Minimize third-party scripts: They often block the main thread. Load them asynchronously or defer them.
Use the Performance panel in DevTools to record interactions and identify long tasks.
Improving CLS: Keep Your Layout Stable
CLS occurs when elements shift unexpectedly. Common culprits are images without dimensions, ads, embeds, and dynamically injected content.
- Always set width and height attributes on images and videos: This allows the browser to reserve space.
- Reserve space for ads and embeds: Use CSS
aspect-ratioor fixed-size containers. - Avoid inserting content above existing content: If you must, do it in response to user interaction.
- Use
font-display: swapcarefully: Swap can cause layout shifts if font metrics differ. Considerfont-display: optionalor preload fonts. - Stick to CSS transforms for animations: They don’t trigger layout shifts.
<!-- Reserve space with aspect-ratio -->
<img src="#" width="800" height="600" alt="...">
Comparison of Core Web Vitals Metrics
| Metric | What it Measures | Good Threshold | Common Fixes |
|---|---|---|---|
| LCP | Loading performance | < 2.5s | Optimize images, preload, CDN |
| INP | Responsiveness | < 200ms | Break long tasks, reduce JS |
| CLS | Visual stability | < 0.1 | Set dimensions, reserve space |
Monitoring and Continuous Improvement
Improving Core Web Vitals is not a one-time task. After you deploy fixes, monitor field data to ensure regressions don’t occur. Set up alerts in your RUM tool for when metrics exceed thresholds. Regularly run Lighthouse in CI to catch performance regressions before they reach production.
Remember that performance is a feature. By prioritizing Core Web Vitals, you deliver a better experience that keeps users engaged and boosts your search rankings.
FAQ
What are the current thresholds for Core Web Vitals?
For LCP, good is under 2.5 seconds, needs improvement is 2.5–4.0 seconds, and poor is over 4.0 seconds. For INP, good is under 200 milliseconds, needs improvement is 200–500 milliseconds, and poor is over 500 milliseconds. For CLS, good is under 0.1, needs improvement is 0.1–0.25, and poor is over 0.25.
How often should I measure Core Web Vitals?
Field data updates daily in CrUX, but it’s a 28-day rolling average. You should monitor continuously and run lab tests after every significant code change. Set up automated Lighthouse runs in your CI/CD pipeline to catch regressions early.
Can I improve Core Web Vitals without a developer?
Some fixes like compressing images or enabling caching can be done via plugins or hosting settings. However, deeper optimizations like code splitting or eliminating render-blocking resources typically require developer involvement. Prioritize the metrics with the most impact based on your field data.
Ready to optimize your images for better LCP? Try our free Image Compressor to reduce file sizes without losing quality.