Responsive Images: srcset and sizes Best Practices

·5 min read
ResponsivesrcsetHTML
Alex Chen· Image Performance Engineer

Responsive images with srcset and sizes serve the right resolution to each device instead of one oversized file. Getting srcset wrong can double your bandwidth, so pair it with modern formats — our WebP guide covers format fallbacks, and the glossary defines srcset, sizes and DPR.

The Problem

A single 2000px image served to a 375px phone wastes 80% of bandwidth. Responsive images solve this.

srcset Explained

<img srcset="img-400.webp 400w, img-800.webp 800w, img-1200.webp 1200w" sizes="(max-width: 600px) 100vw, 50vw" src="img-800.webp" alt="...">

The browser picks the best size based on viewport width and pixel density.

Recommended Breakpoints

  • 320w: Small phones
  • 640w: Large phones
  • 768w: Tablets portrait
  • 1024w: Tablets landscape / small laptops
  • 1536w: Desktops
  • 2048w: Large/retina displays

Art Direction with picture

Use <picture> when you need different crops for different screen sizes, not just different resolutions.

Related Guides

Ready to optimize your images?

Try BulkPicConv — Free