# 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.

Canonical: https://scaplet.com/glossary/responsive-images

Glossary Glossary · Performance

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fresponsive-images%20(%22Responsive%20images%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fresponsive-images%20(%22Responsive%20images%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fresponsive-images%20(%22Responsive%20images%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fresponsive-images%20(%22Responsive%20images%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 3 minutes.

1. [Two problems, two tools 01](#two-problems-two-tools)
2. [Resolution switching with srcset and sizes 02](#resolution-switching-with-srcset-and-sizes)
3. [Art direction with picture 03](#art-direction-with-picture)
4. [Loading hints that go with it 04](#loading-hints-that-go-with-it)
5. [SEO notes 05](#seo-notes)

_01_At 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>`

_02_Checklist

## 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.

First_1_
The browser uses the first matching media condition in `sizes` and ignores the rest, so order them with care.

Next_1_
A slot width can be any length, such as `50vw`, but not a percentage.

Then_1_
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.

_03_Check 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](/glossary/webp) and [AVIF](/glossary/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>
```

_04_At 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](/glossary/cumulative-layout-shift)

Hint

### `loading="lazy"`

Use it for

Images below the fold

Watch out

Don't use it on a hero image [above the fold](/glossary/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](/glossary/largest-contentful-paint)

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.

_05_Checklist

## SEO notes

1. 01 Google says to always specify a fallback URL in `src`, because some browsers and crawlers don't understand `srcset` or `<picture>`.
2. 02 Google 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. 03 Responsive images don't replace [alt text](/glossary/alt-text) or descriptive file context. See [image SEO](/glossary/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. 01 [Using responsive images in HTML - MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Responsive_images) developer.mozilla.org · checked 2026-10-25
2. 02 [Responsive images - web.dev](https://web.dev/learn/design/responsive-images) web.dev · checked 2026-10-25
3. 03 [Image SEO best practices - Google Search Central](https://developers.google.com/search/docs/appearance/google-images) developers.google.com · checked 2026-10-25

Questions

## Asked a lot.

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

_01_ What 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.

_02_ What 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.

_03_ Do 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.

_04_ Should 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.

_05_ Which formats can Google Search index?

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

## Keep learning

[All glossary](/glossary)

[Learn SVG Performance](/glossary/svg) [Related Lazy loading Performance](/glossary/lazy-loading) [Read next AVIF Performance](/glossary/avif) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Reranking](/glossary/reranking) [Responsive search ads](/glossary/responsive-search-ads) [Retention rate](/glossary/retention-rate)

More in Performance
[Largest Contentful Paint](/glossary/largest-contentful-paint) [Lazy loading](/glossary/lazy-loading) [Lighthouse](/glossary/lighthouse) [Page experience](/glossary/page-experience) [Page speed](/glossary/page-speed) [PageSpeed Insights](/glossary/pagespeed-insights) [preconnect](/glossary/preconnect) [preload](/glossary/preload) [Progressive web app](/glossary/progressive-web-app) [Real user monitoring (RUM)](/glossary/real-user-monitoring) [Render-blocking](/glossary/render-blocking) [Responsive design](/glossary/responsive-design) [Responsive images](/glossary/responsive-images) [Service worker](/glossary/service-worker) [Speculation rules](/glossary/speculation-rules) [Speed Index](/glossary/speed-index) [SVG](/glossary/svg) [Synthetic monitoring](/glossary/synthetic-monitoring) [Time to First Byte (TTFB)](/glossary/time-to-first-byte) [Time to Interactive (TTI)](/glossary/time-to-interactive) [Total Blocking Time (TBT)](/glossary/total-blocking-time) [TTL (time to live)](/glossary/ttl) [Viewport meta tag](/glossary/viewport-meta-tag) [WebP](/glossary/webp)

Terms on this page
[WebP](/glossary/webp) [AVIF](/glossary/avif) [Cumulative Layout Shift (CLS)](/glossary/cumulative-layout-shift) [Above the fold](/glossary/above-the-fold) [Largest Contentful Paint](/glossary/largest-contentful-paint) [Image SEO](/glossary/image-seo) [Alt text](/glossary/alt-text)

Free · 2 minutes

## Know the term. _Now check your site._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
