Skip to content We're live on Product Hunt today Upvote
install

free tools runs in this tab no account, no upload

free tool

srcset and sizes

What srcset and sizes does this image need?

The two attributes that decide which file a browser downloads, written from the widths you have. The sizes attribute is the half people leave at 100vw, and that is what makes a 200px avatar fetch the 1600px file.

4 widths Drawn at 50% of the viewport, never wider than 800px.
  • sizes (min-width: 1600px) 800px, 50vw
  • chosen on a 1x phone, 390px 480w
  • chosen on a 2x laptop, 1440px 1600w
  • largest gap between widths a gap over about 400px wastes bytes at the top of it 400px

how to use it

  1. List the widths you have rendered, in pixels, separated by commas.
  2. Say how wide the image is drawn - as a percentage of the viewport, or in px.
  3. Copy both attributes; sizes is not optional, and a wrong one costs more than a missing srcset.

what this page cannot do

The extension reads what a live page actually downloaded against the box the image was drawn in, so an oversized fetch is measured rather than predicted.

Images in the panel Why is my page so heavy?