Products SEO & GEO Agent Paid Ads Agent Website Agent Conversion Agent
How it works Pricing FAQ Blog Book a call

Responsive images: srcset and sizes for faster mobile pages

Updated · 7 min read

Short answer Responsive images give the browser several widths of one photo, so a phone downloads a small file and a big screen a large one. You list the files in srcset and tell the browser how wide the image shows in sizes. Google says to keep a plain src as a fallback. The gain is speed; there is no separate ranking bonus.

Want help applying this to your business? Talk it through on a free 30-minute call.

Book a call

What responsive images do

A responsive image is one photo saved at several widths. The browser picks the smallest file that still looks sharp on the visitor's screen. A phone gets a 600-pixel-wide photo; a large monitor gets the 1,600-pixel one.

Without it, every visitor downloads the biggest version. Google's web.dev team puts the waste plainly:

"Serving desktop-sized images to mobile devices can use 2–4x more data than needed." (web.dev: Serve responsive images)

Two pieces of the image's HTML code do the work:

PartWhat it tells the browserPlain example
`srcset`The files you have and how wide each one is`van-600.jpg 600w, van-1200.jpg 1200w, van-1600.jpg 1600w`
`sizes`How wide the image will show on the page, by screen sizeFull screen width on phones, half the width on larger screens
`src`One plain file for anything that can't read the other two`van-1200.jpg`

The `w` after each number is the file's real width in pixels. It lets the browser choose without downloading anything first (web.dev).

How the browser chooses a file

The browser reads `sizes` first, then picks from `srcset`. MDN's guide to responsive images lists what it weighs: screen size, pixel density, zoom, orientation and network speed. It finds the first `sizes` rule that matches, takes that display width, and loads the file that fits. With no exact match, it takes the next larger file and shrinks it.

Pixel density is why a phone may still pick a fairly big file. Sharp phone screens pack several screen pixels into each layout pixel, so a photo that shows 400 pixels wide may load a wider version. That is still far smaller than a 4,000-pixel original straight from a camera.

`sizes` uses `vw`, short for viewport width: the visible width of the screen. `100vw` means the full width; `50vw` means half.

Do responsive images help SEO?

Indirectly, through speed. Google doesn't rank pages higher for using `srcset`. What it does say:

"[I]mages are often the largest contributor to overall page size, which can make pages slow and expensive to load." (Google Search Central: Image SEO best practices)

Smaller images speed up Largest Contentful Paint (LCP), the time until the main image or text block appears. LCP is one of the Core Web Vitals, and Google says "Core Web Vitals are used by our ranking systems" (Google Search Central: Understanding page experience). Google also ranks the mobile version of your pages: it "uses the mobile version of a site's content, crawled with the smartphone agent, for indexing and ranking" (Google Search Central: Mobile-first indexing). So the phone experience is the one that counts.

Speed is a small factor next to relevance. How much it weighs, and what pass and fail look like: Core Web Vitals and Google ranking.

The one rule Google gives: keep a fallback

Google's image guide asks for one thing:

"[S]ome browsers and crawlers don't understand these attributes. We recommend that you always specify a fallback URL using the src attribute." (Google Search Central: Image SEO best practices)

Google finds images through the `src` of the image tag. If your site builds images with only `srcset`, Google Images may miss them, and Google says it doesn't index CSS background images at all. When you use the `picture` element (a wrapper that offers different files or crops), keep a normal image tag inside it with `src` and alt text. MDN warns that without it, "no images will appear."

Google's mobile-first guide adds: use the same image addresses and the same alt text on mobile and desktop, and don't use image addresses that change on every page load.

Mistakes that cancel the benefit

MistakeWhat happensFix
`srcset` with widths but no `sizes`The browser assumes the image fills the whole screen (`100vw`, per MDN) and downloads too big a file for a half-width photoAdd `sizes` that match your layout
Only one big file uploadedNothing smaller exists to pickUpload one large file (Squarespace suggests 2,500 pixels wide) and let the site make smaller copies, or export 3–5 widths yourself
Lazy loading the top photoThe main image waits, and LCP gets slowerLoad the first-screen image normally
No `width` and `height`The page jumps as images arriveSet both on every image so the browser reserves space
`picture` used just to resizeExtra code with no gainUse `picture` only to swap crops or formats; plain `srcset` handles sizes

Sources for the table: MDN on `sizes` and on `picture`; web.dev on the number of sizes ("common to serve 3-5 different sizes"); web.dev on lazy loading:

"Don't lazy-load images that are likely to be in-viewport when the page loads, especially LCP images." (web.dev: Browser-level image lazy loading)

For the top image, web.dev suggests `fetchpriority="high"` on that one tag, and warns that marking more than one or two images high stops helping (web.dev: Optimize LCP).

A newer option, `sizes="auto"`, lets the browser work out the width itself. MDN says it is only valid on images that also use `loading="lazy"`, so it can't be used for the top photo.

Does your website builder already do this?

Usually yes. Check before paying anyone to add it.

PlatformWhat it does, per its own docs
WordPressSince version 4.4 (2015), adds `srcset` and `sizes` to images it inserts, using the smaller copies it makes on upload (Make WordPress Core)
Squarespace"We create up to seven versions of every image you upload"; suggests 2,500 pixels wide and 500 KB or smaller (Squarespace Help)
WixResizes uploads automatically and converts them to AVIF where possible; suggests files under 1 MB (Wix Help)

The builder can't fix a 15 MB camera photo dropped into a custom code block, a background image set in CSS, or a slider plugin that loads full-size files. Those need a person to check. Platform choice in general: Wix, Squarespace or WordPress for SEO.

How to check your own pages

  1. Run your main service page through PageSpeed Insights on mobile.
  2. Open the "Improve image delivery" item. Since Lighthouse 13 it holds the old "Properly size images" check. Chrome's guidance: a page "should never serve images that are larger than the version that's rendered on the user's screen" (Chrome for Developers).
  3. Note each image it lists and the savings. Tiny savings under 4 KiB aren't flagged.
  4. Fix the biggest first, usually the top photo: smaller upload, `srcset` and `sizes`, no lazy loading.
  5. Re-run the test, then open the page on your own phone over mobile data.

Format and compression matter too: the same Chrome insight suggests stronger compression and newer formats, AVIF or WebP, to cut download size (Chrome for Developers). Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF (Google Search Central).

Example

Illustrative cases, not measured results.

A landscaper's home page

The top photo is a 4,000-pixel, 6 MB upload in a custom code block. Every phone downloads all of it. He re-exports at 600, 1,200 and 2,000 pixels, adds `srcset`, `sizes` and a `src` fallback, and the phone file drops to about 200 KB.

A dental office on Squarespace

PageSpeed flags images, but they're in normal image blocks, so Squarespace already serves smaller copies. The real problem is a 3 MB background video. The office replaces it with a still photo.

A bakery on WordPress

The theme lazy-loads every image, including the hero. Turning lazy loading off for the first image only, and leaving it on below, improves the top of the page.

FAQ

Do I need srcset if I compress my images?

Yes, if one file serves every screen. Compression makes each file lighter; `srcset` stops a phone downloading desktop pixels it can't show. Most sites benefit from both.

Is the picture element better for SEO than srcset?

No. Both are fine for Google as long as there is a normal image tag with `src`. Use `picture` when you need a different crop or format, not just a different size.

How many sizes should I make?

web.dev says three to five is common. More sizes help speed a little but take more storage.

Does Google index every size in srcset?

Google says it finds images in the `src` of the image tag, so make sure that file is the one you want in Google Images, with good alt text.

Different for you?

Keep learning

NextMobile SEO best practices: the complete checklistA mobile SEO checklist for small business sites: what Google reads on phones, speed numbers, local search, buttons, forms, pop-ups, and how to test now.

Do it yourself

Crawlability checklist: make every page reachable by GoogleA crawlability checklist for a small business site: find orphan pages, robots.txt blocks, broken links, redirect chains and server errors, with free tools.

Ask us one question

One line is enough. We reply by email.

Sources

  1. Google Search Central: Image SEO best practices
  2. Google Search Central: Understanding page experience in Google Search results
  3. Google Search Central: Mobile site and mobile-first indexing best practices
  4. web.dev: Serve responsive images
  5. web.dev: Optimize Largest Contentful Paint
  6. web.dev: Browser-level image lazy loading for the web
  7. MDN: Using responsive images in HTML
  8. MDN: The img element
  9. Chrome for Developers: Improve image delivery insight
  10. Chrome for Developers: Properly size images (moved in Lighthouse 13)
  11. Make WordPress Core: Responsive Images in WordPress 4.4
  12. Squarespace Help: Formatting your images for display on the web
  13. Wix Help: Site Performance: Best Practices