Generate srcset the easy way: one upload, every responsive size
Responsive images are simple in theory and fiddly in practice. The theory: give the browser several widths of the same image, describe your layout, and let it download the best-fitting file. The practice: resize the file five times, name everything consistently, hand-write a srcset string without typos, get the sizes attribute right, and add a WebP fallback for good measure. This srcset generator does the whole job in your browser — upload once, download the variants (or one ZIP), paste the snippet.
What srcset and sizes actually do
A normal <img src="photo.jpg"> gives the browser exactly one file, so every visitor — a phone on 4G and a 27-inch monitor on fibre — downloads the same bytes. A responsive image lists candidates instead:
<img src="photo-800.jpg"
srcset="photo-400.jpg 400w, photo-800.jpg 800w, photo-1600.jpg 1600w"
sizes="(max-width: 640px) 100vw, 800px"
width="1600" height="1067" alt="…" loading="lazy">
The 400w descriptors are w descriptors: they state each file's real width in pixels. The sizes attribute tells the browser how wide the image will render in your layout (“full viewport under 640px, otherwise 800px”). From those two facts plus the device's pixel density, the browser picks the smallest file that still looks sharp. No JavaScript, no server logic — the browser does it natively.
w descriptors vs x descriptors
You'll also see srcset="photo.jpg 1x, photo@2x.jpg 2x" — those are x descriptors, which target screen density directly and need no sizes. They're fine for fixed-size UI graphics (logos, icons). For anything whose rendered width changes with the viewport — heroes, content images, cards — w descriptors + sizes are the flexible standard, and that's what this tool generates.
When to use the <picture> element
srcset solves resolution switching (same image, different sizes). The <picture> element solves two more problems: format switching (serve WebP to browsers that support it, JPEG/PNG to the rest) and art direction (a different crop on mobile). This tool's second snippet is the format-switching pattern — a WebP <source> with your chosen format as the fallback <img> — which is the highest-value, lowest-risk use of <picture>.
Fixing PageSpeed's “properly size images”
Lighthouse flags this when it finds images served significantly larger than their rendered size — the classic being a 4000px original displayed at 400px on mobile. The fix it wants is exactly this workflow: generate widths close to the rendered sizes, wire them with srcset/sizes, prefer WebP, and include width/height so the layout doesn't shift (that last one also helps your CLS score). Upload the ZIP contents next to your HTML, paste the snippet, and re-run PageSpeed to see the warning clear.
Which widths to generate
There is no universal set — it depends on your layout — but these starting points cover most sites:
- Full-width hero: 800, 1200, 1600, 2400 with
sizes="100vw"
- Content column: 400, 800, 1200 with sizes matching your column
- 3-column grid cards: 300, 600, 900
- Thumbnails: 150, 300
The tool defaults to 320–1920, which spans all of these. Type your own list if your design needs different breakpoints — anything wider than your source is skipped, because upscaling only inflates file size without adding detail.
Getting sizes right (the part everyone skips)
The most common srcset mistake isn't the files — it's a sizes attribute that doesn't match the real CSS layout. If your image actually renders at 50% viewport but sizes says 100vw, the browser downloads double the pixels it needs on every page view. Pick the preset closest to your layout, or choose Custom and write the real value. When in doubt, open devtools, measure the rendered image width at a few breakpoints, and encode exactly that.
WebP with a real fallback
WebP files are typically 25–35% smaller than equivalent JPEGs, which is why the <picture> snippet leads with a WebP source. But a lone .webp in an <img> still breaks on truly ancient browsers — the fallback <img> inside <picture> covers them with zero extra work. (AVIF would be smaller still, but browsers can't reliably encode AVIF client-side, so this tool sticks to what it can produce honestly: JPEG, WebP, PNG.)
Use cases
Bloggers & WordPress users: generate the set once, upload the files, paste the markup in a Custom HTML block — no plugin needed. Frontend developers: prototype responsive markup without touching sharp, ImageMagick, or a build plugin. Static sites & portfolios: hand-rolled HTML gets proper responsive images in a minute. Core Web Vitals chasers: pair the right sizes with loading="eager" + fetchpriority="high" on your LCP hero and watch the scores move.
The bottom line
One upload, every width, paste-ready markup, honest file sizes shown per variant. Make your images responsive the way the spec intended — and stop shipping 4MB heroes to phones.