---
url: "https://web.dev/articles/optimize-lcp"
titulek: "Optimize Largest Contentful Paint | Articles | web.dev"
h1: "Optimize Largest Contentful Paint Stay organized with collections Save and categorize content based on your preferences."
popis: "A step-by-step guide on how to break down LCP and identify key areas to improve."
jazyk: "en"
kanonicka: "https://web.dev/articles/optimize-lcp"
drobecky: ["Articles", "Optimize Largest Contentful Paint"]
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-14 03:32:16"
znaku: 30069
slov: 4745
kodovani: "iso-8859-2"
sha256: "65881f134799619f882871efb2d6ef995df3016790356362b53cd233dffee59d"
---
Optimize Largest Contentful Paint
Stay organized with collections
Save and categorize content based on your preferences.
A step-by-step guide on how to break down LCP and identify key areas to improve.
Philip Walton
Barry Pollard
Published: April 30, 2020, Last updated: March 31, 2025
[Largest Contentful Paint (LCP)](/articles/lcp) is one of the three [Core Web Vitals](/articles/vitals#core_web_vitals) metrics, and it represents how quickly the main content of a web page is loaded. Specifically, LCP measures the time from when the user initiates loading the page until the largest image or text block is rendered within the viewport. To provide a good user experience, **sites should strive to have an LCP of 2.5 seconds or less for at least 75% of page visits.**
A good LCP value is 2.5 seconds or less.
A number of factors can affect how quickly the browser can load and render a web page, and delays across any of them can have a significant impact on LCP. It's rare that a quick fix to a single part of a page will result in a meaningful improvement to LCP. To improve LCP, you have to look at the entire loading process and make sure every step along the way is optimized. Understanding your LCP metric Before optimizing LCP, developers should seek to understand if they even have an LCP issue, and the extent of any such issue. LCP can be measured in a number of tools and not all of these measure LCP in the same way. To understand LCP of real users, we should look at what real users are experiencing, rather than what a lab-based tool like [Lighthouse](https://developer.chrome.com/docs/lighthouse) or local testing shows. These lab-based tools can give a wealth of information to explain and help you improve LCP, but be aware that lab tests alone may not be entirely representative of what your actual users experience. LCP data based on real users can be surfaced from Real User Monitoring (RUM) tools installed on a site, or by using the [Chrome User Experience Report (CrUX)](https://developer.chrome.com/docs/crux) which collect anonymous data from real Chrome users for millions of websites. Using Chrome DevTools CrUX LCP data The Performance panel of Chrome DevTools shows your local LCP experience next to the page or origin's CrUX LCP in the [live metrics view](https://developer.chrome.com/docs/devtools/performance/overview#live-metrics), and in the [Insights](https://developer.chrome.com/docs/devtools/performance/reference#insights) of a performance trace including a breakdown of the LCP subpart timings (that we will explain shortly).
Local and field LCP in the Chrome DevTools Performance panel live metrics and trace views.
By layering field data onto the Performance panel, you can assess whether a page has any real-user LCP issues and adapt your local environment settings to better reproduce and debug those issues. Using PageSpeed Insights CrUX LCP data [PageSpeed Insights](https://pagespeed.web.dev/) provides access to CrUX data in the top section labeled **Discover what your real users are experiencing**. More detailed lab-based data is available in the bottom section labeled **Diagnose performance issues**. If CrUX data is available for your website, always concentrate on the real user data first.
CrUX data shown in PageSpeed Insights.
PageSpeed Insights shows up to four different CrUX data: **Mobile** data for **This URL** **Desktop** data for **This URL** **Mobile** data for the whole **Origin** **Desktop** data for the whole **Origin** You can toggle these in the controls at the top and top right-hand side of this section. If a URL doesn't have enough data to be shown at the URL level, but does have data for the origin, PageSpeed Insights always shows the origin data.
When PageSpeed Insights doesn't have URL-level data, it shows
origin-level data.
The LCP for the whole origin may be very different to an individual page's LCP depending on how the LCP is loaded on that page compared to other pages on that origin. It can also be affected by how visitors navigate to these pages. Home pages tend to be visted by new users and so may often be loaded "cold", without any cached content and so are often the slowest pages on a website. Looking at the four different categories of CrUX data can help you understand whether an LCP issue is specific to this page, or a more general site-wide issue. Similarly, it can show which device types have LCP issues. Using PageSpeed Insights CrUX supplementary metrics Those looking to optimize LCP should also use the [First Contentful Paint (FCP)](/articles/fcp) and [Time to First Byte (TTFB)](/articles/ttfb) timings, which are good diagnostic metrics that can provide valuable insights into LCP. TTFB is the time when the visitor starting to navigate to a page (for example, clicking on a link), until the first bytes of the HTML document are received. A high TTFB can make achieving a 2.5 second LCP challenging, or even impossible. A high TTFB can be due to multiple server redirects, visitors located far away from the nearest site server, visitors on poor network conditions, or an inability to use cached content due to query parameters. Once a page starts rendering, there may be an initial paint (for example, the background color), followed by some content appearing (for example, the site header). The appearance of the initial content is measured by FCP. The delta between FCP and other metrics can be very telling. A large delta between TTFB and FCP could indicate that the browser needs to download a lot of render-blocking assets. It can also be a sign it must complete a lot of work to render any meaningful contentâa classic sign of a site that relies heavily on client-side rendering. A large delta between FCP and LCP indicates that the LCP resource is either not immediately available for the browser to prioritize (for example, text or images that are managed by JavaScript rather than being available in the initial HTML), or that the browser is completing other work before it can display the LCP content. Using PageSpeed Insights Lighthouse data The Lighthouse section of PageSpeed Insights offers some guidance to improving LCP, but first you should check if the LCP given is broadly in agreement with real user data provided by CrUX. If Lighthouse and CrUX disagree, then CrUX likely provides a more accurate picture of your user experience. Make sure your CrUX data is for your page, not the full origin, before you act on it. If both Lighthouse and CrUX show LCP values that need improvement, the Lighthouse section can provide valuable guidance on ways to improve LCP. Use the LCP filter to only show audits relevant to LCP as follows:
Lighthouse diagnostics and suggestions for improving LCP.
As well as the **Opportunities** to improve, there is **Diagnostic** information that may provide more information to help diagnose the issue. The **Largest Contentful Paint element** diagnostic shows a useful breakdown of the various timings that made up the LCP:
Lighthouse's breakdown of LCP elements.
LCP resource types and subparts are also [available in CrUX](https://developer.chrome.com/blog/crux-2025-02). We will delve into these subparts next. LCP breakdown Optimizing for LCP can be a more complex task when PageSpeed Insights does not give you the answer on how to improve this metric. With complex tasks it's generally better to break them down into smaller, more manageable tasks and address each separately. This section presents a methodology for how to break down LCP into its most critical subparts and then present specific recommendations and best practices for how to optimize each part. Most page loads typically include a number of network requests, but for the purposes of identifying opportunities to improve LCP, you should start by looking at just two: The initial HTML document The LCP resource (if applicable) While other requests on the page can affect LCP, these two requestsâspecifically the times when the LCP resource begins and endsâreveal whether or not your page is optimized for LCP. To identify the LCP resource, you can use developer tools (such as PageSpeed Insights discussed before, [Chrome DevTools](https://developer.chrome.com/docs/devtools), or [WebPageTest](https://webpagetest.org/)) to determine the [LCP element](/articles/lcp#what_elements_are_considered). From there you can match the URL (again, if applicable) loaded by the element on a [network waterfall](https://developer.chrome.com/docs/devtools/network/reference) of all resources loaded by the page. For example, the following visualization shows these resources highlighted on a network waterfall diagram from a typical page load, where the LCP element requires an image request to render.
A waterfall diagram showing the loading times for
a webpage's HTML and the resources the LCP needs.
For a well-optimized page, you want your LCP resource request to start loading as early as it can, and you want the LCP element to render as quickly as possible after the LCP resource finishes loading. To help visualize whether or not a particular page is following this principle, you can break down the total LCP time into the following subparts: [Time to First Byte (TTFB)](/articles/ttfb) The time from when the user initiates loading the page until the browser
receives the first byte of the HTML document response. Resource load delay The time between TTFB and when the browser starts loading the LCP resource. If
the LCP element doesn't require a resource load to render (for example, if the
element is a text node rendered with a system font), this time is 0. Resource load duration The duration of time it takes to load the LCP resource itself. If the LCP
element doesn't require a resource load to render, this time is 0. Element render delay The time between when the LCP resource finishes loading and the LCP element
rendering fully.
The same waterfall diagram, with the four LCP subparts overlaid
on the timeline.
Every single page can have its LCP value broken down into these four subparts. There is no overlap or gap between them. Collectively, they add up to the full LCP time. When optimizing LCP, it's helpful to try to optimize these subparts individually. But it's also important to keep in mind that you need to optimize all of them. In some cases, an optimization applied to one part won't improve LCP, it will just shift the time saved to another part. For example, in the earlier network waterfall, if you reduced the file size of our image by compressing it more or switching to a more optimal format (such as AVIF or WebP), that would reduce the **resource load duration**, but it wouldn't actually improve LCP because the time would just shift to the **element render delay** subpart:
Shortening the resource load duration increases the element render delay without reducing LCP.
The reason this happens is because, on this page, the LCP element is hidden until the JavaScript code finishes loading, and then everything is revealed at once. This example helps illustrate the point that you need to optimize all of these subparts in order to achieve the best LCP outcomes. Optimal subpart times In order to optimize each subpart of LCP, it's important to understand what the ideal breakdown of these subparts is on a well-optimized page. Of the four subparts, two have the word "delay" in their names. That is a clue that you want to get these times as close to zero as possible. The other two parts involve network requests, which by their very nature take time. LCP subpart % of LCP Time to first byte ~40% Resource load delay <10% Resource load duration ~40% Element render delay <10% **TOTAL** **100%** Note that these time breakdowns are guidelines, not strict rules. If the LCP times on your pages are consistently within 2.5 seconds, then it doesn't really matter what the relative proportions are. But if you're spending a lot of unnecessary time in either of the "delay" portions, then it will be very difficult to constantly hit the [2.5 second target](/articles/lcp#what_is_a_good_lcp_score). A good way to think about the breakdown of LCP time is: The **vast majority** of the LCP time should be spent loading the HTML document and LCP source. Any time before LCP where one of these two resources is *not* loading is **an opportunity to improve**. How to optimize each part Now that you understand how each of the LCP subpart times should break down on a well-optimized page, you can start optimizing your own pages. The next four sections will present recommendations and best practices for how to optimize each part. They're presented in order, starting with the optimizations that are likely to have the biggest impact. 1. Eliminate *resource load delay* The goal in this step is to ensure the LCP resource starts loading as early as possible. While in theory the earliest a resource *could* start loading is immediately after TTFB, in practice there is always some delay before browsers actually start loading resources. A good rule of thumb is that your LCP resource should start loading at the same time as the first resource loaded by that page. Or, to put that another way, if the LCP resource starts loading later than the first resource, then there's opportunity for improvement.
On this page, the LCP resource starts loading well after the style
sheet that loads first. There's room for improvement here.
Generally speaking, there are two factors that affect how quickly an LCP resource can be loading: When the resource is discovered. What priority the resource is given. Optimize when the resource is discovered To ensure your LCP resource starts loading as early as possible, it's critical that the resource is discoverable in the initial HTML document response by the browser's [preload scanner](/articles/preload-scanner). For example, in the following cases, the browser can discover the LCP resource by scanning the HTML document response: The LCP element is an `` element, and its `src` or `srcset` attributes are present in the initial HTML markup. The LCP element requires a [CSS background image](/articles/optimize-css-background-images-with-media-queries), but that image is preloaded using `` in the HTML markup (or using a `Link` header). The LCP element is a text node that requires a web font to render, and the font is loaded using `` in the HTML markup (or using a `Link` header). Here are some examples where the LCP resource cannot be discovered from scanning the HTML document response: The LCP element is an `
` that is dynamically added to the page using JavaScript. The LCP element is lazily loaded with a JavaScript library that hides its `src` or `srcset` attributes (often as `data-src` or `data-srcset`). The LCP element requires a CSS background image. In each of these cases, the browser needs to run the script or apply the stylesheetâwhich usually involves waiting for network requests to finishâbefore it can discover the LCP resource and could start loading it. This is never optimal. To eliminate unnecessary resource load delay, your LCP resource should be discoverable from the HTML source. In cases where the resource is only referenced from an external CSS or JavaScript file, the LCP resource should be preloaded with a high fetch priority, for example: `
` Optimize the priority the resource is given Even if the LCP resource is discoverable from the HTML markup, it *still* may not start loading as early as the first resource. This can happen if the browser preload scanner's priority heuristics don't recognize that the resource is important, or if it determines that other resources are more important. For example, you can delay your LCP image using HTML if you set [`loading="lazy"`](/articles/browser-level-image-lazy-loading) on your `
` element. Using lazy loading means that the resource won't be loaded until after layout confirms the image is in the viewport and so may begin loading later than it otherwise would. Even without lazy loading, images are not initially loaded with the highest priority by browsers as they are not render-blocking resources. You can hint to the browser as to which resources are most important using the [`fetchpriority`](/articles/fetch-priority) attribute for resources that could benefit from a higher priority: `
` It's a good idea to set `fetchpriority="high"` on an `` element if you think it's likely to be your page's LCP element. However, setting a high priority on more than one or two images makes priority setting unhelpful in reducing LCP. You can also lower the priority of images that might be early in the document response but aren't visible due to styling, such as images in carousel slides that aren't visible at startup: `
` Deprioritizing certain resources can afford more bandwidth to resources that need it moreâbut be careful. Always check resource priority in DevTools and test changes with lab and field tools. After you have optimized your LCP resource priority and discovery time, your network waterfall should look like this (with the LCP resource starting at the same time as the first resource):
The LCP resource now starts loading at the same time as the style sheet.
2. Eliminate *element render delay* The goal in this step is to ensure the LCP element can render *immediately* after its resource has finished loading, no matter when that happens. The primary reason the LCP element *wouldn't* be able to render immediately after its resource finishes loading is if rendering is [blocked](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources) for some other reason: Rendering of the entire page is blocked due to stylesheets or synchronous scripts in the `