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

Use the browser’s native loading="lazy" attribute for images that start below the fold, and leave images visible on initial load—especially the likely Largest Contentful Paint (LCP) image—to load eagerly. Reserve each image’s space with dimensions, optimize its file size separately, then measure the page before and after. Lazy loading delays a request; it does not compress or resize the image.

How native image lazy loading works

When an image has loading="lazy", the browser can defer requesting it until the image is near the visible area. The browser chooses how near; HTML does not provide a setting for an exact fetch distance. This makes native lazy loading a straightforward way to avoid downloading below-the-fold images that a visitor may never see.

As MDN Web Docs puts it in its image performance guidance: “One of the biggest improvements to most websites is lazy-loading images beneath the fold, rather than downloading them all on initial page load regardless of whether a visitor scrolls to see them or not.” The benefit depends on the page: it can reduce initial image requests, but it does not guarantee a faster result for every visitor or metric.

Which images should be lazy-loaded?

Below-the-fold content images

Lazy-load images that are not visible when the page first appears, such as later gallery items or article images farther down the page. Add the attribute to the image itself:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<img src="gallery-1.webp" alt="A ceramic mug on a wooden table" width="1200" height="800" loading="lazy">

Use the image’s actual intrinsic width and height, or provide an equivalent aspect-ratio reservation in CSS. The browser can then allocate the correct space before the file arrives.

Hero, above-the-fold, and likely LCP images

Do not lazy-load an image visible in the initial viewport, particularly the image likely to become the page’s LCP element. Delaying its request can postpone the page’s most important visual content. The Google Chrome team’s web.dev guide, “Browser-level image lazy loading for the web,” says: “For images that are visible when the user first loads the page, and especially for LCP images, use the browser’s default eager loading so they can be available right away.”

For an important image that is not discoverable until external CSS or script processing, consider whether it can be made discoverable in the initial HTML. If not, the web.dev LCP optimization guide discusses preloading the resource. fetchpriority="high" can signal that an important image should receive priority, but it is not a substitute for checking the actual page’s loading behavior.

Images inside a picture element

When using <picture> with alternative sources, place loading="lazy" on its fallback <img> element. The browser selects a suitable source while the image element carries the loading behavior.

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

Reserve space to prevent layout shifts

Give images intrinsic width and height attributes, or reserve the same aspect ratio with CSS. This lets the browser lay out the page before image bytes arrive and reduces the chance that text or other content jumps when an image loads. Dimensions also help the browser understand that a deferred image occupies space: without them, a gallery can appear to contain zero-sized images that are already in the viewport, undermining the intended deferral.

For a responsive image, the intrinsic dimensions describe its source image; CSS can still scale it to fit the layout. The important point is that the layout has enough information to reserve the image’s proportions before download.

Lazy loading versus custom JavaScript

Approach Complexity Trigger control Fallback and risk
Native loading="lazy" Low: add an HTML attribute. The browser decides when a deferred image is close enough to fetch; page code cannot set the threshold. Modern browsers support the feature. Browsers that do not recognize the attribute ignore it, so images still load but miss the deferral benefit. Keep visible and LCP images eager-loaded.
JavaScript with IntersectionObserver Higher: requires script, lifecycle handling, and fallback decisions. Can define a custom preloading buffer or other trigger behavior. Use only when a specific requirement calls for more control or fallback support. Incorrect triggers can delay visible or LCP images.

For ordinary off-screen images, native loading is the sensible baseline; do not add a lazy-loading library by default. Check compatibility against the browsers your audience actually uses if legacy support matters.

When custom trigger control is justified

If a concrete requirement calls for a custom trigger, an IntersectionObserver can begin loading before an image reaches the viewport. For example, web.dev shows a bottom rootMargin of 256px as a buffer. That is an example, not a universal value: choose and test a margin for the page’s layout, scrolling behavior, and resource-loading needs.

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

Reduce image bytes separately

Lazy loading changes when an image is requested, not how many bytes the image contains. For images that do load, reduce transfer cost by choosing an appropriate format, compressing the asset, and serving dimensions suited to the rendered size and device. Responsive image techniques can help deliver a smaller source where a large desktop image is unnecessary.

Image weight has historically been a substantial part of page weight. MDN reported that median image resource weight increased from about 250 KB to 900 KB on desktop and from about 100 KB to 850 KB on mobile between 2011 and 2019. Those are figures for that historical period, not current page averages; use measurements of your own pages to decide what to optimize.

Measure the effect on the page

  1. Identify the LCP element. Inspect a representative page with browser developer tools or Lighthouse. Determine whether the LCP element is an image and whether it is visible at initial load.
  2. Inspect request discovery. Check when the LCP image request begins relative to the initial document and other resources. Avoid making that image wait behind lazy-loading logic or late CSS and script discovery.
  3. Apply lazy loading to off-screen images. Keep dimensions or equivalent aspect-ratio space on each image, and avoid applying the attribute indiscriminately to all images.
  4. Compare before and after. Test representative pages, devices, and network conditions. Compare LCP and image resource timing, and check that images appear in time during scrolling and that layout remains stable.

Google’s current LCP good-experience target is 2.5 seconds or less for at least 75% of page visits, as described in the web.dev LCP guide (last updated March 31, 2025). This is a Core Web Vitals target, not a result promised by adding loading="lazy".

Troubleshoot common problems

  • The hero image appears late. Check whether it has loading="lazy" despite being visible initially. Remove lazy loading from visible and likely LCP images, then inspect when the browser discovers the request.
  • Images jump into place after loading. Add real width and height attributes or reserve the correct aspect ratio in CSS so the browser allocates space in advance.
  • Below-the-fold images still load early. Confirm that dimensions are present and that the images are genuinely outside the initial viewport. Native behavior uses a browser-chosen distance threshold, not an author-set boundary; test on the browsers and pages that matter.
  • Images do not defer in an older browser. The browser may not support the attribute and can ignore it. Check the audience’s compatibility needs; retain a library only if fallback behavior or custom trigger control is important.
  • Lazy loading did not reduce the image’s file size. That is expected. Optimize format, compression, and responsive dimensions separately.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a screenshot of a page, use ScreenshotNeo, a website screenshot API and MCP server for developers. Its API captures a URL in one request; it is not a replacement for implementing or measuring lazy loading on your own site.

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.
Best Value
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

cURL (see the ScreenshotNeo API docs):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month, with no card.

Frequently Asked Questions

Does native lazy loading need JavaScript?

No. Add loading="lazy" to the relevant <img> element; the browser handles deferred fetching.

Does loading="lazy" have a fixed fetch distance?

No. The browser chooses when a deferred image is close enough to fetch; HTML does not expose a page-authored threshold.

Quick Recap

Bestseller No. 1
Bestseller No. 2
Bestseller No. 5
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

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.

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