TapCub is live — analytics, insights and live chat, free on one platform
Analytics

Lazy Loading Images: How to Do It Without Hurting LCP

Lazy loading images saves bytes only if the hero image stays eager. Three rules for loading=lazy, a keep-eager table, a worked 24-image page and how to verify the change with real-visitor LCP.

Xu An Published Nov 23, 2026 12 min read Analytics
Sample data: one 24-image listing page in four variants. Lazy loading the hero (B) is slower than doing nothing (A); keeping it eager and prioritised (D) is the only variant under the 2.5 s good line.Sample data

Lazy loading images means telling the browser to fetch below-the-fold images only when the visitor scrolls near them, using loading="lazy". It cuts image bytes, but only if the hero image stays eager: lazy loading the largest visible element makes Largest Contentful Paint slower. Below: the rules, a worked page, and a check with real visitor data.

What you will learn

  • Add loading="lazy" with width and height to images below the first screen; keep the hero eager and give it fetchpriority="high"
  • Lazy loading every image is worse than none: in the sample, LCP went from 2.9 s to 3.6 s, while the correct setup reached 2.3 s
  • Verify with a 7-day real-visitor baseline of LCP at the 75th percentile, per page type and device, before and after

What does lazy loading do to images?

Lazy loading postpones the download of an image until the visitor is likely to see it. Without it, the browser requests every <img> on the page as soon as it parses the HTML, including pictures that sit seven screens down. With it, an image far below the fold costs nothing until the reader scrolls toward it.

Two numbers frame the problem. The HTTP Archive reports that at the 90th percentile, sites send more than 5 MB of images on both desktop and mobile (figure quoted by web.dev). And Largest Contentful Paint (LCP) is rated good at 2.5 seconds or less, measured at the 75th percentile of page loads. Lazy loading attacks the first number, but you only win if the second one does not move the wrong way.

Without lazy loadingWith lazy loading
Every image is requested during page loadImages outside the initial viewport wait until the reader scrolls near them
Bandwidth competes with the hero image and the CSSEarly bandwidth is left for what is visible
Visitors who never scroll still download everythingVisitors who never scroll download only the first screen
Nothing to get wrongEasy to delay the hero image and make LCP worse

The rest of this article is about the last row: how to get the savings without the penalty, and how to prove it with your own data.

How do you lazy load images with loading="lazy"?

The native way needs no JavaScript library. Add loading="lazy" to an image that is not in the first screen, and give it dimensions:

<img src="/img/gallery-07.jpg" alt="Gallery photo 7"
     width="800" height="600" loading="lazy" decoding="async">

Three rules cover most cases.

  1. Set width and height on every image. web.dev explains that without dimensions an image counts as 0 by 0 until it loads, which can make a whole gallery appear to fit the viewport and be fetched at once. A late-loading image without reserved space also pushes the text around when it arrives, which raises Cumulative Layout Shift.
  2. Leave loading off (or set eager) for anything visible on load. eager is the browser default, so you rarely need to write it.
  3. Lazy load everything below the first screen. The browser decides the trigger distance. In July 2020 Chrome cut the distance on 4G from 3000 px to 1250 px, and on slower connections from 4000 px to 2500 px, so images start loading shortly before they scroll into view.

On how well it works: web.dev reports that in Chrome experiments on Android, 97.5% of lazy-loaded images on 4G had fully loaded within 10 ms of becoming visible, and 92.6% on 2G. Readers rarely see a blank placeholder.

For images that must be set from CSS or are swapped by script, an IntersectionObserver is the fallback, but it is more code to maintain and the native attribute is enough for ordinary <img> tags.

Which images should never be lazy loaded?

The most common mistake is adding loading="lazy" to every image, including the hero. That tells the browser to delay the biggest visible element, so the LCP time grows by exactly the delay you added. web.dev's advice is direct: do not lazy load images likely to be visible when the page loads, especially the LCP image; use fetchpriority="high" on that image to raise its priority instead.

The HTTP Archive's 2024 Web Almanac measured how common the mistake is: 9.5% of mobile pages used native loading="lazy" on their LCP image, and 16% of mobile pages with an image LCP lazy loaded it once script-based methods (such as hiding the source in a data-src attribute) were included. A rule of thumb for deciding:

ImageLazy load?Why
Hero or banner at the topNo, add fetchpriority="high"Usually the LCP element
Logo and first row of product cardsNoVisible on load
Anything the visitor must scroll toYesThe saving is the whole point
Image inside a closed tab or accordionYesNot visible until clicked
Image that appears after a click (modal, carousel slide 2+)YesSame reason
Responsive image that is hero on mobile but hidden on desktopCheck bothThe LCP element can differ by screen size

The last row matters because the "first screen" is not one size. On a phone the hero may be the first product photo; on a desktop it may be the third. Check both layouts, as described in the next section.

ImageLazy load?Why
Hero or banner at the topNo, add fetchpriority="high"Usually the LCP element
Logo and first row of product cardsNoVisible on load
Images the visitor must scroll toYesThe saving is the whole point
Images in closed tabs or accordionsYesNot visible until clicked
Hero on mobile that is hidden on desktopCheck both sizesThe LCP element can differ by screen

Decide per layout: the first screen is not one size.

How to find your LCP image

Open the page in Chrome DevTools, record a load in the Performance panel, and look at the LCP marker: it points to the element. Or run the page through a lab tool and read its "Largest Contentful Paint element" line. Do it for a phone-sized window and a desktop-sized one.

web.dev lists what counts as an LCP candidate: <img> elements, <image> inside an SVG, the poster or first frame of a <video>, an element with a CSS url() background image, and block-level text. If your LCP is text, image lazy loading will not move it, and the whole question changes. If your LCP is a CSS background image, loading="lazy" on <img> tags does not apply to it at all.

Then build the list: first-screen images stay eager, the LCP image gets fetchpriority="high", everything else gets loading="lazy".

What should the before and after numbers look like?

Sample data: a product listing page with 24 images. The hero image is 220 KB, two other first-screen images are 150 KB each, and 21 images below the fold average 180 KB.

MeasureAll eagerLazy below the fold
Image bytes in the initial load4,300 KB520 KB (−87.9%)
Image bytes after a typical visit4,300 KB1,843 KB (−57.1%)
LCP, 75th percentile2.9 s2.6 s

The initial load is 220 + 150 + 150 = 520 KB, against 520 + 21 × 180 = 4,300 KB without lazy loading. The "typical visit" row depends on how far people scroll. Assume 35% stop at the first screen, 30% load six more images, 20% load twelve and 15% load all 21. The average number of lazy images fetched is 0.30 × 6 + 0.20 × 12 + 0.15 × 21 = 7.35, or 1,323 KB, so the page averages 520 + 1,323 = 1,843 KB.

Now the part that decides whether you improved anything. Same page, four variants (sample LCP at the 75th percentile):

VariantLCP p75Rating
A. Nothing lazy2.9 sNeeds improvement
B. loading="lazy" on every image including hero3.6 sNeeds improvement
C. Lazy only below the fold2.6 sNeeds improvement
D. C plus fetchpriority="high" on the hero2.3 sGood

Variant B is the trap: fewer bytes in the end, a slower page where it counts. Variant D is the target. The values are illustrative, but the order is what you will typically see: lazy loading everything is worse than doing nothing, and saved bandwidth only becomes a faster LCP when the hero is prioritised.

Finally, layout shift. If you leave out width and height, assume lazy-loaded images will shove content when they arrive; reserving the box keeps CLS under the 0.1 "good" line.

app.tapcub.com

LCP at the 75th percentile

sample page, seconds
A. Nothing lazy2.9 s
B. Everything lazy3.6 s
C. Below the fold only2.6 s
D. C plus fetchpriority2.3 s
Sample data
Sample data: one 24-image listing page in four variants. Lazy loading the hero (B) is slower than doing nothing (A); keeping it eager and prioritised (D) is the only variant under the 2.5 s good line.

How do you verify the change with real visitor data?

A lab run on your laptop is one load on one connection. The change you care about is what visitors on ordinary phones experienced. Verify in four steps.

  1. Write down the baseline for 7 days before the change: LCP at the 75th percentile and the share rated good, per page type (product list, article, home page), by device.
  2. Ship the change to one template and note the date.
  3. Wait for the same number of days and compare the same page type and the same device. Check traffic mix did not change in between (a campaign launch will shift the device split on its own).
  4. Look at behavior too. A faster page that loses its bounce-rate gains because images flash in late is not a win. Check bounce rate, pages per session and the conversion rate of those pages.

Watch for these pitfalls: a promo week skews the baseline; a 3G-heavy country showing up in the sample changes the percentile; a small page type (under a few hundred loads) makes the 75th percentile jump around.

How to check the result in TapCub

TapCub measures page speed from real visitors' browsers, so it can show the before-and-after for the template you changed. TapCub does not measure page weight or fetch your images; for bytes use the browser's network panel. TapCub only does the measuring.

  1. Before you ship, open Monitoring › Performance. The cards show LCP, CLS, INP, FCP and TTFB; switch the LCP card to P75 and note the value and the share rated good (thresholds: 2.5 s good, 4 s poor).
  2. Break down by page and device to find your slowest pages: the Slowest pages list is sorted by P75 LCP, so the product listing page is likely near the top.
  3. Mark the release with Configuration › Annotations so the chart carries a line on the day you shipped.
  4. After the same number of days, open the same view and compare P75 for the same pages. If the P75 got worse, check that the hero image was not lazy loaded.
  5. Open Web analytics › Pages and compare bounce rate and average time for the same pages across the two periods.

Two caveats. The page is empty if the script is blocked or an old snippet does not collect vitals, and percentiles jump around on pages with few samples, so judge changes on pages with steady traffic.

FAQ

Does lazy loading improve LCP?

Only indirectly. Deferring below-the-fold images frees bandwidth for the hero, which can lower LCP, but lazy loading the hero itself makes LCP worse. In the sample above, lazy loading everything gave 3.6 s against 2.9 s with no lazy loading, while the correct setup with a prioritised hero gave 2.3 s.

Should I lazy load every image?

No. Lazy load images that start outside the viewport. Images visible on load, especially the LCP image, should load eagerly, and the LCP image can be marked with fetchpriority="high". In 2024, about 9.5% of mobile pages in the HTTP Archive still lazy loaded the LCP image with the native attribute.

Does loading="lazy" work in all browsers?

In a browser that ignores the attribute the image simply loads normally, so nothing breaks; it is a hint, not a requirement. If you need to support unusual environments, an IntersectionObserver script is the fallback.

Is lazy loading bad for SEO?

The native attribute keeps the real address in src, so the image is plain HTML. The risk is script-based lazy loading that hides the address in data-src: anything that does not run the script, such as some crawlers or a visitor with scripts off, never sees the image. Prefer src plus loading="lazy".

How do I stop layout shift with lazy images?

Give every image width and height, or a CSS aspect ratio, so the browser reserves the space before the file arrives. web.dev notes that dimensions matter more with lazy loading because late images without them add to Cumulative Layout Shift.

Sources

Filed underAnalytics

Was this article helpful?

We use your answers to fix and expand this page.

Xu An

Customer Experience Consultant

Writes about live chat, visitor conversations, and self-service, sharing practical ways to make customer communication clearer and more effective.

See real-visitor LCP by page

P75 largest contentful paint, the slowest pages and a release annotation, so you can check a lazy-loading change against real visits.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics