What Is Largest Contentful Paint (LCP)?
Largest Contentful Paint (LCP) is a Core Web Vital metric that measures the render time of the largest visible content element — typically a hero image, background image, or block-level text — within the browser's viewport. It is defined by the W3C Largest Contentful Paint API and captures the point at which the page's primary content is perceived as loaded by the user. Google considers an LCP under 2.5 seconds 'Good', between 2.5–4 seconds 'Needs Improvement', and above 4 seconds 'Poor'.
What Is Largest Contentful Paint (LCP)?
Largest Contentful Paint (LCP) is a Core Web Vital metric that measures the render time of the largest visible content element — typically a hero image, background image, or block-level text — within the browser's viewport. It is defined by the W3C Largest Contentful Paint API and captures the point at which the page's primary content is perceived as loaded by the user. Google considers an LCP under 2.5 seconds 'Good', between 2.5–4 seconds 'Needs Improvement', and above 4 seconds 'Poor'.
How Largest Contentful Paint (LCP) Works
The browser continuously tracks candidate elements as the page renders, reporting the largest visible element in the viewport by rendered area. Eligible element types include <img>, <image> inside SVGs, <video> poster frames, elements with CSS background-image loaded via url(), and block-level elements containing text nodes. The LCP candidate updates each time a larger element becomes visible, and the final LCP value is recorded when the user first interacts with the page (scroll, click, keypress) or when the page's lifecycle reaches the 'hidden' state — whichever comes first. Internally, the browser calculates the 'size' of each candidate as the visible portion of the element within the viewport, not its intrinsic dimensions. An image that is partially off-screen only counts for the area that is visible. This means that oversized hero images that bleed beyond the fold are not penalized for their full dimensions, but images with significant layout shift before rendering can cause the LCP candidate to change mid-load, effectively resetting the clock. LCP is reported via the PerformanceObserver API using the 'largest-contentful-paint' entry type, allowing developers to observe it programmatically in JavaScript. Tools like Chrome DevTools Performance panel, Lighthouse, WebPageTest, and CrUX (Chrome User Experience Report) all surface this metric. The distinction between lab data (Lighthouse) and field data (CrUX) is critical: Lighthouse runs in a controlled environment and can miss real-world variables like CDN latency, cache state, or slow mobile connections. The most common LCP bottlenecks are render-blocking resources that delay the browser's ability to paint anything, server response time (TTFB), slow image delivery, and client-side rendering frameworks that defer content behind JavaScript execution. For images specifically, the browser cannot begin downloading an image until it discovers the URL — either in the HTML parser or via CSS — so any mechanism that delays discovery (lazy loading, JS injection, CSS background on a class toggled by JS) directly delays LCP.
Best Practices for Largest Contentful Paint (LCP)
Preload the LCP image using <link rel='preload' as='image' href='hero.webp'> in the <head> so the browser fetches it at the highest priority before the parser reaches the <img> tag. Never apply native lazy loading (loading='lazy') to above-the-fold images — this is one of the most common LCP regressions and delays the fetch until the element enters the viewport. Serve images in next-gen formats (WebP or AVIF) and use responsive srcset with correctly sized variants so mobile users aren't downloading a 1400px image for a 390px screen. Minimize Time to First Byte (TTFB) by using a CDN with edge caching, since LCP cannot start until the server delivers the initial HTML; a TTFB above 800ms almost guarantees a poor LCP on most networks. For text-based LCP elements, ensure the web font is preloaded and the font-display descriptor is set to 'swap' or 'optional' to avoid invisible text blocking the LCP paint. Finally, inline critical CSS that controls above-the-fold layout directly in the <head> to eliminate render-blocking stylesheet requests.
Largest Contentful Paint (LCP) & Canvas Builder
Canvas Builder generates production-ready Bootstrap 5 HTML where above-the-fold content is structured with semantic elements like <section>, <h1>, and standard <img> tags — giving browsers a clear, early signal to identify and prioritize the LCP candidate without waiting for JavaScript execution. Because the output is static HTML rather than a client-rendered JavaScript bundle, there is no hydration delay or JS parsing overhead blocking the initial paint, which is one of the most common causes of poor LCP in modern web apps. Developers exporting sites from Canvas Builder can easily instrument the HTML with fetchpriority='high' on hero images and <link rel='preload'> tags in the <head>, since the clean, readable output requires no reverse-engineering of framework internals to locate and modify the critical rendering path.
Try Canvas Builder →