ensure that a browser loads the appropriate image variant depending on screen size, resolution and layout. This way a small smartphone display does not receive the same huge file as a large desktop screen. It saves data and improves loading time, which especially benefits on mobile devices.

Technically, responsive images are implemented via the srcset and sizes attributes, which describe several image sizes for the browser to choose from:

  • srcset lists different image variants with their widths,
  • sizes describes how much space the image occupies in the layout,
  • in addition, width and height should be set to avoid layout shifts ().

Responsive images are ideally combined with modern formats such as or AVIF. Especially on mobile devices with weaker connections, the right image size is an effective performance lever.