October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Lazy Loading Images: Best Practices for Faster Websites

Defer off-screen images with native lazy loading, but keep initially visible and LCP images eager. Learn how to prevent layout shifts and measure the impact.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For faster pages, use native loading="lazy" on images that start below the fold, but leave images visible on initial load—especially the likely Largest Contentful Paint (LCP) image—eager-loaded. Set image dimensions to reserve layout space, optimize image bytes separately, and measure the result on representative pages. Lazy loading delays requests; it does not compress or resize images.

When to lazy-load an image

Lazy loading postpones a non-critical image request until the browser judges that the image is close enough to the viewport to be needed. This can avoid downloading images a visitor never scrolls to see. For ordinary content images below the initial viewport, use the browser’s native HTML feature:

As an Amazon Associate I earn from qualifying purchases.

<img src="gallery-1.webp" alt="Description of the image" width="1200" height="800" loading="lazy">

Use the image’s real intrinsic width and height, or provide an equivalent aspect ratio, so the browser can lay out the page before the image arrives. For an image inside a <picture> element, put loading="lazy" on its fallback <img>.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should you lazy-load the hero or LCP image?

No, not when it is visible as the page first loads. Keep the hero image and other initially visible images on the default eager behavior so the browser can discover and request them promptly. The Google Chrome team’s web.dev guide, “Browser-level image lazy loading for the web,” advises using default eager loading for images visible on initial load, especially LCP images.

Identify the page’s LCP element rather than assuming it is always the hero image. The browser’s initial HTML should expose an important image as early as possible. If the image is discoverable only after external CSS or script processing, web.dev’s LCP optimization guide discusses preloading it. The fetchpriority="high" attribute can signal priority for an important image, but it is not a substitute for checking actual loading behavior.

Reserve space to prevent layout shifts

Set width and height to the image’s intrinsic dimensions, even if CSS later scales it responsively. For example:

<img src="gallery-1.webp" alt="Description of the image" width="1200" height="800" loading="lazy" style="max-width:100%;height:auto">

The browser can use those dimensions to reserve the right aspect ratio before the file downloads, reducing unexpected movement as images appear. Dimensions also give the browser useful layout information when deciding whether an image is near the viewport; without them, a collection of unloaded images may appear to have no size.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Native lazy loading or JavaScript?

Approach Best fit Trade-off
Native loading="lazy" Most below-the-fold images on modern browsers Simple markup; the browser controls when the request starts, and the page cannot set a custom threshold distance.
JavaScript with IntersectionObserver A specific requirement for custom trigger timing, or a fallback for browsers that need one More code and behavior to maintain; poor timing can make an image appear late.

Browsers that do not support the native attribute ignore it: the image still loads, but the deferral benefit is absent. Check compatibility against the browsers your audience uses if legacy support matters. Modern browser support makes a JavaScript library unnecessary by default.

If a concrete requirement calls for custom timing, start loading before the image reaches the viewport. For example, web.dev shows rootMargin: "0px 0px 256px 0px" as a possible buffer. That is an example, not a universal threshold; tune and measure for the page and devices involved.

Reduce image bytes separately

Lazy loading changes when a request begins, not the size of the transferred image. For images that do load, choose a suitable format, compress appropriately, and serve dimensions that match the rendered size. Responsive image markup can let the browser choose among available sizes:

Rank #4
Class Record Book for 9-10 Weeks. 50 Names. Smaller Size 7" x 11" (R9010)
  • 8 1/2 x 11 Teacher Record Book with Teacher's daily schedule
  • Special duties
  • Supplementary data sheets
  • Grade recording sheets for 40 weeks with shading every other two lines
  • Perforated grade recording sheets - write the class list only once
<img src="photo-1200.webp"
     srcset="photo-480.webp 480w, photo-800.webp 800w, photo-1200.webp 1200w"
     sizes="(max-width: 600px) 100vw, 800px"
     width="1200" height="800" loading="lazy"
     alt="Description of the image">

MDN’s “Multimedia: Images” notes that lazy-loading below-the-fold images can avoid downloading all images on initial page load regardless of whether a visitor scrolls to them. Its historical figures show median image weight rising from about 250 KB to 900 KB on desktop and about 100 KB to 850 KB on mobile between 2011 and 2019; those figures describe that period, not current page averages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Measure the change on real pages

  1. Find the LCP element. Use browser developer tools or Lighthouse on representative pages. Confirm whether it is an image and whether it is visible on initial load.
  2. Inspect request timing. Check when the LCP image request starts relative to the initial document and other resources. Look for avoidable discovery delays.
  3. Apply lazy loading only to off-screen images. Preserve eager loading for initially visible content, and ensure dimensions are present.
  4. Compare before and after. Test representative pages, devices, and network conditions. Check LCP and image resource timing, not just whether the HTML attribute is present.

Web.dev’s LCP guide sets a good-experience target of 2.5 seconds or less for at least 75% of page visits. That is a Core Web Vitals target, not a result guaranteed by adding lazy loading; page behavior must be measured.

Troubleshooting common problems

  • The hero image appears late: Remove loading="lazy" from images visible on initial load, especially the LCP image. Check whether the browser can discover it from initial HTML.
  • Images pop in and move the page: Add intrinsic width and height, or another way to reserve the correct aspect ratio.
  • Images appear only at the last moment: If using custom JavaScript, trigger loading before the image reaches the viewport and tune the observer buffer for the actual page. Native lazy-loading thresholds are browser-controlled.
  • Images download but the page is still heavy: Lazy loading does not reduce file size. Serve appropriately sized images and use suitable formats and compression.
  • Older browsers download every image immediately: The attribute is ignored where unsupported. Confirm the audience’s browser requirements and add a JavaScript fallback only if needed.

Or skip the browser setup

If you need screenshots to check how a page renders, ScreenshotNeo is a website screenshot API and MCP server. Its one-request API can return an image or PDF; it does not replace performance measurement or tell you whether lazy loading improved LCP.

cURL example, with the target URL set to your page:

Quick Recap

Bestseller No. 1
Bestseller No. 2
Bestseller No. 4
Class Record Book for 9-10 Weeks. 50 Names. Smaller Size 7' x 11' (R9010)
Class Record Book for 9-10 Weeks. 50 Names. Smaller Size 7" x 11" (R9010)
8 1/2 x 11 Teacher Record Book with Teacher's daily schedule; Special duties; Supplementary data sheets
$11.60
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.