Responsive image slot planner calculator

For each slot, choose the smallest supplied source width at least as large as slot × pixel ratio.

Your inputs

Separate numbers with commas or spaces.
Input format

Use this format with your own values:

320,600
Separate numbers with commas or spaces.
Input format

Use this format with your own values:

2,1
Separate numbers with commas or spaces.
Input format

Use this format with your own values:

400,640,800

Use the units shown.

Required source widths (px)
640, 600
Selected source widths or missing targets
640, 640

Your calculation
How is this calculated?

Round up each CSS slot width × its device pixel ratio.

Pick the smallest available source at least that wide; otherwise show the missing minimum.

For each slot, choose the smallest supplied source width at least as large as slot × pixel ratio. Report a missing source when none fits. This deterministic planning rule does not reproduce every browser image-selection decision; it ignores art direction and network preferences.

MDN: responsive images and pixel density ↗

Try an example

Worked example

Required source widths (px): 640, 600

Inputs
  • Rendered slot widths (CSS px): 320,600
  • Device pixel ratios for those slots: 2,1
  • Available source widths (image px): 400,640,800

Compare inputs

Required source widths (px): 150, 500

Inputs
  • Rendered slot widths (CSS px): 100,250
  • Device pixel ratios for those slots: 1.5,2
  • Available source widths (image px): 200,400
Share this page
Share this calculator

Leave unchecked to share the page without your entered values.