Largest Contentful Paint (LCP): what slows it down and how to fix it
How LCP is measured, the four parts every LCP time breaks into, and the specific fixes for slow servers, late-discovered images, heavy files and render-blocking code.
By Abdessamad Bettal. Published . 5-minute read.
On this page
Largest Contentful Paint (LCP) is the time from when a visitor starts loading a page until the largest image or block of text in the first screen is drawn. It is the Core Web Vital that answers "has the page loaded?", and the limits are simple: 2.5 seconds or less is good, more than 4 seconds is poor, measured at the 75th percentile of real visits.
LCP is also the Core Web Vital many sites find hardest to pass on phones. The good news is that its causes are well understood, and you can find which one applies to you with a methodical approach.
What counts as the largest element
The browser watches what is painted while the page loads and keeps track of the largest visible element. Candidates are:
<img>elements, including the first frame of an animated image<image>elements inside an SVG- the poster image of a
<video> - elements with a background image loaded through CSS
url() - block-level elements that contain text, such as headings and paragraphs
Size means the visible area on screen, not the file size. Elements that are invisible, fully transparent or that cover the whole viewport like a background are ignored. The browser stops looking for a new candidate as soon as the visitor interacts with the page.
On most pages the LCP element is a hero image, a product photo or the main headline. In Chrome DevTools, the Performance panel shows which element it is, and that is the first thing to find out, because the fixes for an image and for text are different.
The four parts of every LCP time
Every LCP time breaks into four consecutive parts. Measuring them tells you exactly where the time goes.
- Time to first byte. How long until the first byte of the HTML arrives. Nothing can happen before this.
- Resource load delay. The gap between the first byte and the moment the browser starts downloading the LCP image. For a text element this part is zero.
- Resource load duration. How long the LCP image takes to download.
- Element render delay. The time between the image finishing and it appearing on screen, usually spent waiting for stylesheets, scripts or fonts.
Google's rough guide for a healthy page is that most of the time should go on the first and third parts, with the two delays kept to a small fraction each. When one of the delays is large, you have found your problem.
Fix a slow server response
If the first part is large, the server is the bottleneck, and every other speed measure inherits the delay. Check it with the TTFB test, which splits the time into DNS, connection, encryption and the server's own work.
The most effective fixes are:
- Cache the finished HTML so the server does not rebuild the page for each visitor. Pages that are the same for everyone can be served from a CDN.
- Remove redirects in front of the page. Each one repeats the whole round trip. The redirect checker shows every hop.
- Serve from close to the visitor with a CDN, so connection setup is short.
Our server speed checklist covers these in more depth.
Fix a late start on the image
A large resource load delay means the browser found out about the image late. Common causes:
- The image is lazy-loaded. Never put
loading="lazy"on the LCP image: it tells the browser to wait. - The image is set as a CSS background, so the browser only learns about it after downloading and parsing the stylesheet.
- The image is added by JavaScript, for example by a carousel or a client-rendered framework, so it appears only after scripts run.
The fix is to make the image discoverable in the HTML and tell the browser it matters:
<img
src="/hero-1200.avif"
srcset="/hero-800.avif 800w, /hero-1200.avif 1200w"
sizes="100vw"
width="1200"
height="600"
alt="Running shoes on a track"
fetchpriority="high"
/>
fetchpriority="high" moves the request ahead of less important ones. If the image cannot be in the HTML, for example a background image, preload it in the page head:
<link rel="preload" as="image" href="/hero-1200.avif" fetchpriority="high" />
If the image lives on another domain, the browser must also open a new connection to it. Serving it from your own domain avoids that, and a preconnect hint shortens it when you cannot.
Fix a slow download
A long resource load duration means the file is too heavy for the connection. Make it smaller:
- Use a modern format. WebP and AVIF are much smaller than JPEG or PNG at similar quality. Our image compressor converts and compresses in your browser.
- Serve the right size. A phone does not need a 3000-pixel-wide image. Use
srcsetandsizesso each device downloads a suitable file. - Cache it. Images with versioned file names can be cached for a year. The cache checker shows what browsers and CDNs are allowed to keep.
Fix a late render
When the image has arrived but is not yet on screen, something is blocking rendering:
- Render-blocking stylesheets and scripts in the page head. Keep the CSS for the first screen small and load scripts with
defer. The page size checker counts the blocking files on a page. - Web fonts, when the LCP element is text. With
font-display: swaporoptional, text appears in a fallback font instead of waiting. - Client-side rendering, where the page arrives empty and JavaScript builds it. Rendering the first screen on the server is usually the biggest single LCP win for these sites.
Check that the fix worked
Change one thing at a time and re-test in a lab tool to confirm the improvement. Then watch your field data: real-visitor figures cover 28 days, so the full effect takes up to four weeks to show. A site lookup on pagespeed.tools charts LCP week by week, so you can see the change land.
For how LCP fits with the other two measures, see Core Web Vitals explained.
Check it on your own site
Written by
Web developer and the builder of pagespeed.tools: free tools for finding what slows a website down and fixing it.
More guides
Core Web Vitals explained: LCP, INP and CLS in plain languageWhat the three Core Web Vitals measure, the limits Google uses, how the 75th percentile and the 28-day window work, and where to start fixing a slow site.5-minute read
Interaction to Next Paint (INP): make your page respond to every tapHow INP measures responsiveness, the three phases of every interaction, how to find the slow ones on your site, and practical ways to keep the main thread free.4-minute read
Cumulative Layout Shift (CLS): stop your page from jumpingHow CLS is calculated, the usual causes of layout shift, from images without dimensions to late fonts and injected banners, and how to fix each one.4-minute read