Responsive Image srcset Planner

Work out which image widths to export for srcset and sizes from your layout and screen densities, and get ready <img> and <picture> code with AVIF and WebP.

Tool

Was this tool useful?

About this tool

About Responsive Image srcset Planner

Serving one big image to every screen wastes data on phones, and too-small images look blurry on retina screens. Enter how wide the image appears at each breakpoint (like “(max-width: 600px) 100vw”), the screen densities you support and your original width. The planner calculates the pixel widths each device needs, merges sizes that are close together so you export fewer files, and writes the srcset and sizes attributes, an <img> tag with width, height and lazy loading, and a <picture> version with AVIF and WebP.

How it works

Needed width = CSS width × device pixel ratio, capped at the original width. Widths within the merge percentage of the previous one are joined. vw values use the breakpoint width (or your widest screen for the last line).

Example

(max-width: 600px) 100vw and 400px with 1x and 2x needs 400, 600, 800 and 1200 px images.

How to use this tool

  1. Enter the CSS width of the image at each breakpoint, last line for other screens.
  2. Set densities (1, 2, 3), your original width and how close sizes may be merged.
  3. Export your image at the listed widths and paste the code.

Frequently asked questions

Why do I need the sizes attribute?

Without it the browser assumes the image fills the whole screen (100vw) and often downloads a much bigger file than needed.

How many sizes should I make?

Usually 3–6. More files give smaller downloads but more work; the merge setting keeps the list short.

Is my data uploaded?

No. Everything runs in your browser and stays on this device.

Does the Responsive Image srcset Planner send my data to a server?

No. The Responsive Image srcset Planner runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.