Updated

Technology · Code & frameworks

LazySizes

github.com
Open source

What is LazySizes?

lazysizes is a JavaScript library that loads images, iframes and scripts only when they are about to come into view. It is free, open source software under the MIT license.[1][2]

LazySizes is a lightweight, feature-rich JavaScript library used for lazy loading images, iframes, scripts, and other resources. It intelligently loads content only when it's about to enter the viewport, significantly improving page load times and reducing bandwidth usage. LazySizes is highly configurable and works without any dependencies, making it an excellent choice for optimizing web performance.

LazySizes belongs toJavaScript librariesPerformancecategories.

What it loads

Images, responsive images, iframes and scripts or widgets[1]

Setup

No JavaScript configuration needed[1]

License

MIT[2]

Install

Download the script or install it with npm[1]

113websites

use it — 4.5% of the 2,539 websites we scanned in the last 12 months

#9of 108

tools in its category seen in our scans (we recognize 253)

11public pages

on UptimeCard — open any of them to see how that site is doing

In short: a lazy loader that needs no configuration and also helps with responsive images; the newest GitHub release dates from 2021, so check that it still fits your pages.[1][3]

5.76% of all websites we track run LazySizes▲ 0.01 points since 20 Sep

What is LazySizes used for?

In short, from the websites we scan

Lazy loading images
Images load only when they come into view, using a lazyload class and a data-src attribute.[1]
Lazy loading iframes and widgets
Iframes, scripts and widgets can be loaded lazily in the same way as images.[1]
Responsive images
It can calculate the sizes attribute for responsive images automatically.[1]
Preloading images near the view
Assets near the view are preloaded while the browser network is idle, so images in view load first.[1]
What it does
LazySizes is one of the javascript libraries tools websites use. In our scans it is #9 of the 108 we see. Also listed under Performance.
On real websites
Among 11 public websites we scan that use it: lazy-loading images (11 sites), boosting Core Web Vitals (4 sites), deferring offscreen images (3 sites). Counted automatically from a short description of each site (one site can do several jobs), so read it as an estimate.
Used together with
It is often installed next to Google Analytics, PHP, Swiper.

Should you use LazySizes?

The 10-second version, from the vendor’s own pages and what we see in our scans

LazySizes fits if…

  • You want images and iframes loaded lazily without writing JavaScript configuration[1]
  • You use responsive images and want the sizes attribute calculated for you[1]

Look elsewhere if…

  • You only need the browser's own image loading and no extra script[1]The project page lists a native load event it complements.
The newest release on GitHub is from 2021, so verify behavior in current browsers[3]

LazySizes versions

The newest release, the series that still gets fixes, and what changed

Latest release

5.3.2[2]

Maintained series

5

What LazySizes sites add on top

How many of the 113 LazySizes sites we scanned also run each tool, grouped by what the tool does

Analytics

Google Analytics
74%84 sites
Facebook Pixel
29%33 sites
Microsoft Clarity
22%25 sites

Tag manager

Google Tag Manager
72%81 sites

Online store

Cart Functionality
23%26 sites

Cookie consent

OneTrust
19%21 sites
Funding Choices
15%17 sites

Search visibility

Yoast SEO
17%19 sites

The full bar means every LazySizes site. A site can run several tools for one job, so the shares of tools in one group can add up to more than 100%.

How LazySizes sites protect themselves

Share of the 113 sites we scanned that run each protection

HSTS54% · 61 sites

HTTP Strict Transport Security (HSTS) informs browsers that the site should only be accessed using HTTPS

reCAPTCHA30% · 34 sites

reCAPTCHA is a free service from Google that helps protect websites from spam and abuse

Cloudflare Bot Management13% · 15 sites

Cloudflare bot management solution identifies and mitigates automated traffic to protect websites from bad bots

Protections add up, they do not replace each other: a site can run all of them.

What sites use LazySizes for

An estimate from UptimeCard's technology map of 11 public sites

Runs the whole site8 sites

activecampaign.com · bcit.ca · egnyte.com

Runs the marketing site2 sites

lightspeedhq.com · telna.com

Hosts help, docs or support content1 sites

posit.co

Rough guide, not a measurement: each description is written automatically from the site’s technology stack and the site has not confirmed it. A site is counted once, in the first group its description fits (shop, help and docs, blog, marketing site; otherwise the whole site). Descriptions that only guess (“likely”, “may”) are left out.

At a glance

UptimeCard's own scans and tests of 2,539 websites · refreshed weekly

How LazySizes sites scoreout of 100 · hover or tap a score for details

43PerformancePooraverage site: 5190AccessibilityGoodaverage site: 9192Best practicesGoodaverage site: 9692SEOGoodaverage site: 92

Page load time

Loads about 61% slower than the average site

LazySizes sites
5.6 s
All sites
3.5 s

Most LazySizes sites load in 4.4–8.9 s. Home page weight: 5.8 MB vs 3.4 MB for all sites. 10 public sites measured.

Who uses it?

Technology and Software is the biggest group

Technology and Software46%
Software as a Service (SaaS)18%
Economic Data and Analysis9%
Educational Resources9%

Share of 11 classified public sites. “× average” compares with all 961 public sites.

How LazySizes sites are built

Closest partners. The number says how many times more often the tool runs on LazySizes sites than on an average website. Hover a partner for its share of sites.

Twitter Ads3×Swiper3×Prebid3×Funding Choices2×Microsoft Clarity2×jQuery UI2×

Stacks we see most. Tools that tend to run together with LazySizes on the same websites. The percentage is the share of all 113 LazySizes sites that run the whole stack.

11 stacks · swipe, drag or use the arrows
#1

LazySizes + Yoast SEO + Elementor

6.2%7 of 113 sites
#2

LazySizes + jsDelivr + Varnish + Drupal

3.5%4 of 113 sites
#3

LazySizes + Funding Choices + Google Hosted Libraries

4.4%5 of 113 sites
#4

LazySizes + Yoast SEO + Contact Form 7

4.4%5 of 113 sites
#5

LazySizes + Elementor + Contact Form 7

4.4%5 of 113 sites
#6

LazySizes + Yoast SEO + Site Kit

4.4%5 of 113 sites
#7

LazySizes + Elementor + Site Kit

4.4%5 of 113 sites
#8

LazySizes + Funding Choices + Varnish

3.5%4 of 113 sites
#9

LazySizes + YouTube + Drupal

3.5%4 of 113 sites
#10

LazySizes + jsDelivr + Unpkg

3.5%4 of 113 sites
#11

LazySizes + Yoast SEO + Autoptimize

3.5%4 of 113 sites

Similar tools in its category

JavaScript libraries: 253 tools known, 108 seen in our scans

How websites combine LazySizes with other tools

Relationships found on the websites that use it, from the same map status pages show.

Complements another tool 19Integrates with another 1

Websites using LazySizes

113 websites use LazySizes: 4.5% of the 2,539 websites we scanned in the last 12 months. A selection is shown below.

Scores are out of 100: P Performance · A Accessibility · B Best practices · S SEO. Green 80+, yellow 65–79, orange 50–64, red below 50. The dot shows whether our last scan found the site failing (red) or not (green); Red, amber or blue: an active incident on the site's status page (outage, degraded, maintenance) or a failing scan; amber also means a certificate ending within 30 days. Hover the dot for details.

Who is behind LazySizes

From its own pages and public records, with sources

LazySizes

since 2014[4]

Its story

  1. 2014

    The lazysizes repository was created on GitHub, starting a lazy loader that also integrates responsive images.[4]

  2. 2019

    Version 5.0.0 was released, a new major version of the loader published on GitHub and npm.[5]

  3. 2021

    Version 5.3.1 was released and is the newest tagged release on GitHub.[3]

Questions about LazySizes

What is LazySizes?
lazysizes is a JavaScript library that loads images, iframes and scripts only when they are about to come into view. It is free, open source software under the MIT license.
What is LazySizes used for?
Images load only when they come into view, using a lazyload class and a data-src attribute. Iframes, scripts and widgets can be loaded lazily in the same way as images. It can calculate the sizes attribute for responsive images automatically. Assets near the view are preloaded while the browser network is idle, so images in view load first. LazySizes is one of the javascript libraries tools websites use. In our scans it is #9 of the 108 we see. Also listed under Performance. Among 11 public websites we scan that use it: lazy-loading images (11 sites), boosting Core Web Vitals (4 sites), deferring offscreen images (3 sites). Counted automatically from a short description of each site (one site can do several jobs), so read it as an estimate. It is often installed next to Google Analytics, PHP, Swiper.
How do I mark an image to load lazily?
Add the class lazyload to the img or iframe and use a data-src or data-srcset attribute instead of src or srcset.[1]
Does lazy loading hide images from search engines?
The project states that lazysizes does not hide images or assets from Google, and reveals all images instantly when the user agent cannot scroll.[1]
How do I install lazysizes?
Download the script and include it in your page, or install it with npm.[1]
Which license does lazysizes use?
MIT.[2]
How many websites use LazySizes?
We found LazySizes on 113 of the 2,539 websites we scanned in the last 12 months (4.5%). 11 of them have a public status page.
What are the alternatives to LazySizes?
Other javascript libraries tools we recognize include jQuery, core-js, Swiper, jQuery Migrate.

Is your website built with LazySizes?

Create a free status page that shows your visitors your site is up. It also gives your site its own public page where new people can discover it.

Example status page card