Back to knowledges

Core Web Vitals

Published: Sep 19, 2025
By: Pedro Henrique Braga de Castro

Core Web Vitals are essential performance metrics that every frontend developer should master. These metrics were created by Google to improve their search indexation and provide a standardized way to measure user experience quality.

Understanding and optimizing these metrics is crucial for better search rankings, improved user experience, and higher conversion rates. Let's dive deep into each metric and learn how to measure and optimize them.

Largest Contentful Paint

LCP
Good: ≤2.5s | Needs Improvement: 2.5-4s | Poor: >4s

Measures the time it takes for the largest content element to render on screen. This metric is crucial because it indicates when the main content becomes visible to users.

Key Elements Measured:

  • Image elements (<img>)
  • Video elements (<video>)
  • Background images via url()
  • Block-level elements containing text

Sub-metrics:

  • FCP (First Contentful Paint): Time until first DOM element appears
  • TTFB (Time To First Byte): Time until first byte reaches the browser

Optimization Tips:

  • Optimize and compress images
  • Use modern image formats (WebP, AVIF)
  • Implement lazy loading for below-the-fold content
  • Minimize server response times
  • Remove unused CSS and JavaScript

Interaction to Next Paint

INP
Good: ≤200ms | Needs Improvement: 200-500ms | Poor: >500ms

Measures the responsiveness of user interactions. It captures the time from when a user interacts with the page until the browser paints the next frame.

Key Elements Measured:

  • Click interactions
  • Tap interactions on touch devices
  • Key press interactions

Sub-metrics:

  • Input delay: Time from interaction to event handler start
  • Processing time: Time spent executing event handlers
  • Presentation delay: Time from handler completion to next paint

Optimization Tips:

  • Break up long tasks into smaller chunks
  • Use web workers for heavy computations
  • Minimize main thread work
  • Optimize event handlers
  • Use requestIdleCallback for non-critical tasks

Cumulative Layout Shift

CLS
Good: ≤0.1 | Needs Improvement: 0.1-0.25 | Poor: >0.25

Quantifies visual stability by measuring unexpected layout shifts. It helps ensure that pages are visually stable as they load.

Key Elements Measured:

  • Images without dimensions
  • Ads, embeds, and iframes
  • Dynamically injected content
  • Web fonts causing FOIT/FOUT

Sub-metrics:

  • Impact fraction: Portion of viewport affected by shift
  • Distance fraction: How far shifted elements moved

Optimization Tips:

  • Always include size attributes on images and videos
  • Reserve space for ads and dynamic content
  • Use font-display: swap for web fonts
  • Avoid inserting content above existing content
  • Use CSS aspect-ratio for responsive media

Measurement Tools

Primary Tools

PageSpeed Insights: Google's official tool that provides lab and field data for Core Web Vitals. It offers specific recommendations for each metric and shows real user experience data when available.

Lighthouse: Available in Chrome DevTools, as a browser extension, or CLI tool. Provides detailed performance audits with actionable recommendations for improving Core Web Vitals.

MetricWhat it measuresGood thresholdPrimary impact
LCPLoading performance≤2.5 secondsPerceived loading speed
INPInteraction responsiveness≤200 millisecondsUser interaction feedback
CLSVisual stability≤0.1Layout stability during load

Conclusion

Core Web Vitals are not just SEO metrics—they're fundamental indicators of user experience quality. By focusing on loading performance (LCP), interaction responsiveness (INP), and visual stability (CLS), you create websites that users love and search engines reward.

Remember: Monitor continuously! Web performance is not a one-time optimization but an ongoing process. Set up monitoring, establish performance budgets, and make Core Web Vitals part of your development workflow.