Free auditStart free
GlossaryGlossary · Performance

Responsive images

Responsive images let the browser pick the right file for each screen. See srcset, sizes and picture with working code, plus the loading hints and SEO notes.

3 min
read
3
sources
Oct 22, 2026
updated
Scaplet Editorial Team
author
In one line

Responsive images are images that adapt to the device: you give the browser several files, using srcset and sizes for different resolutions or the picture element for different crops, and it picks one. Google recommends always keeping a src fallback, because some browsers and crawlers don't understand srcset or picture.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01At a glance

Two problems, two tools

MDN splits responsive images into two problems. Resolution switching serves the same picture at different pixel sizes, so a phone doesn't download a desktop file. Art direction serves a different crop for different layouts, such as a portrait close-up on a narrow screen.
Need

Same image, different widths

Markup
srcset with w descriptors, plus sizes
Need

Same size, sharper on high-density screens

Markup
srcset with x descriptors, no sizes
Need

Different crops or formats

Markup
<picture> with <source> elements and a final <img>
02Checklist

Resolution switching with srcset and sizes

srcset lists the files and their intrinsic widths using the w unit, not px. sizes tells the browser how wide the image slot will be under each media condition. The browser works out the first true condition, takes that slot width, and loads the srcset file that matches, or the first bigger one.
First1
The browser uses the first matching media condition in sizes and ignores the rest, so order them with care.
Next1
A slot width can be any length, such as 50vw, but not a percentage.
Then1
Keep <meta name="viewport" content="width=device-width"> in the head, since some mobile browsers otherwise load at a larger viewport width.
From MDN's responsive images guide
<img
  srcset="elva-fairy-480w.jpg 480w, elva-fairy-800w.jpg 800w"
  sizes="(width <= 600px) 480px, 800px"
  src="elva-fairy-800w.jpg"
  alt="Elva dressed as a fairy" />

In MDN's example the 800px file is 128KB and the 480px file is 63KB, so the narrow screen saves 65KB for one image. Across a page of images that adds up.

03Check it

Art direction with picture

<picture> wraps <source> elements and a required <img>. Each source has a media condition and the first one that is true is used. The <img> with src and alt is the default when none match, and the fallback for browsers without <picture>.

Use the same element to offer newer formats. Google's example lists an SVG source, a WebP source and a PNG <img> fallback. See WebP and AVIF.

From MDN. Different crops by viewport width
<picture>
  <source media="(width < 800px)" srcset="elva-480w-close-portrait.jpg" />
  <source media="(width >= 800px)" srcset="elva-800w.jpg" />
  <img src="elva-800w.jpg" alt="Chris standing up holding his daughter Elva" />
</picture>
04At a glance

Loading hints that go with it

Hint

width and height

Use it for
Every image whose size you know
Watch out
Lets the browser reserve space and stops content jumping. See CLS
Hint

loading="lazy"

Use it for
Images below the fold
Watch out
Don't use it on a hero image above the fold
Hint

fetchpriority="high"

Use it for
Your most important image, such as the LCP image
Watch out
Prioritizing one resource de-prioritizes another. See LCP

web.dev also recommends the CSS img { max-inline-size: 100%; block-size: auto; } so images never render wider than their container while keeping their aspect ratio.

05Checklist

SEO notes

  1. 01Google says to always specify a fallback URL in src, because some browsers and crawlers don't understand srcset or <picture>.
  2. 02Google Search supports images in src in these formats: BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. Match the file extension to the file type.
  3. 03Responsive images don't replace alt text or descriptive file context. See image SEO.
Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • mozilla.org
  • web.dev
  • google.com
  1. 01Using responsive images in HTML - MDNdeveloper.mozilla.org · checked 2026-10-25
  2. 02Responsive images - web.devweb.dev · checked 2026-10-25
  3. 03Image SEO best practices - Google Search Centraldevelopers.google.com · checked 2026-10-25
Questions

Asked a lot.

5 questions people ask next, answered from the sources on this page.

01What is a responsive image?

It's an image the browser can load at different sizes, resolutions or crops depending on the device. HTML does this with srcset and sizes on img, or with the picture element.

02What is the difference between srcset and picture?

srcset with sizes switches between sizes or resolutions of the same image. picture lets you serve different crops or formats, using media conditions on source elements.

03Do I still need the src attribute?

Yes. Google recommends a fallback URL in src because some browsers and crawlers don't understand srcset or picture, and MDN says the img element with src and alt is required inside picture.

04Should I lazy-load every responsive image?

No. web.dev says images below the fold can use loading="lazy", but a hero image above the fold shouldn't.

05Which formats can Google Search index?

Google Search supports images in src in these formats: BMP, GIF, JPEG, PNG, WebP, SVG and AVIF.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly