Lazy loading means a page loads some resources only when they're about to be needed, usually when the visitor scrolls near them. Images, embedded videos and maps far down the page wait, so the browser can spend its first seconds on what the visitor actually sees.
The opposite is eager loading, the browser's default: fetch everything as soon as the page asks for it.
Why it helps
A long page might have 40 images, but a visitor on a phone sees two or three at first. Downloading the other 37 straight away competes with the content on screen, uses the visitor's data and may be wasted if they never scroll. Lazy loading shortens the critical rendering path, the work the browser must finish before it can show the page.
The gain is biggest on long pages with many images or embeds: category pages, image galleries, long articles and pages with video or map embeds.
Lazy loading images and iframes with HTML
You don't need JavaScript for images and iframes. Add one attribute:
<img src="kitchen.jpg" loading="lazy" alt="Kitchen after renovation" width="800" height="600">
<iframe src="https://www.youtube.com/embed/VIDEO_ID" loading="lazy" title="Product demo"></iframe>
All current major browsers support it:
| Element | Chrome | Firefox | Safari |
|---|---|---|---|
<img loading="lazy"> |
77+ | 75+ | 15.4+ |
<iframe loading="lazy"> |
77+ | 121+ | 16.4+ |
Edge, built on Chromium, supports whatever Chrome does. Browsers that don't support the attribute ignore it and load the image normally, so it's safe to add. Support for loading="lazy" on <video> and <audio> is new and experimental: as of October 2026, only Chrome and Edge (from version 150) support it MDN.
The browser decides how close an image must get before it starts loading. Chrome, for example, starts about 1,250 pixels before an image comes into view on fast connections and 2,500 pixels on slower ones, so images are usually ready by the time the visitor reaches them. Lazy loading only happens when JavaScript is enabled; without it, the browser loads everything eagerly.
Lazy loading with JavaScript
For anything else, or for more control, use JavaScript:
- Intersection Observer. This browser API tells your code when an element enters or nears the viewport, so you can load it then. Most lazy-loading libraries use it.
- Code splitting. Split JavaScript into chunks and load the rest with
import()when a feature is used, for example a chat widget's code only after someone opens the chat.
What not to lazy-load
Anything visible when the page opens. Lazy loading makes the browser wait until layout confirms an element is in view, which delays it. Google's web.dev guidance says to never lazy-load the image that's your Largest Contentful Paint element, usually the hero image, because it always slows LCP web.dev.
The catch is that "visible at first" depends on the screen. A rough rule: eager-load the first few images in the main content and lazy-load the rest. Test on both a phone and a large monitor.
Images without dimensions. Always set width and height (or a CSS aspect ratio). Otherwise the page jumps when the image arrives, which hurts Cumulative Layout Shift. It can also make lazy loading misjudge which images are in view.
Lazy loading and SEO
Done right, lazy loading doesn't hide anything from Google. Done wrong, it can. The key fact from Google's documentation: Google Search doesn't interact with your page. It doesn't scroll, click or tap Google Search Central.
So:
- Load content when it's in the viewport, not after a user action. The
loadingattribute, Intersection Observer and good libraries all do this. Content that loads only after a scroll event, a click on "Load more" or a hover may never be seen by Google. - Give infinite scroll real URLs. If more items load as people scroll, make each chunk reachable at its own permanent URL (such as
?page=12), link the pages in order, and update the address bar as the visitor scrolls. See pagination. - Check what Google sees. In Search Console, run the URL Inspection tool and look at the rendered HTML. If your image URLs appear in the
srcattributes of the<img>elements, Google can find them.
Lazy loading isn't an SEO technique in itself. It's a speed technique, and speed is part of page experience.