What is srcset?
Definitionsrcset is an HTML attribute for img and source elements that lists several versions of an image at different sizes or pixel densities, so the browser can download the one best suited to the visitor's screen.
With srcset, an image can offer, for example, a small, medium and large file, each labeled with its width in pixels, or 1x and 2x versions for standard and high-density displays. Used with the sizes attribute, which tells the browser how wide the image will appear in the layout, it lets the browser choose before downloading, so phones are not forced to load images meant for large desktop screens.
Responsive images built with srcset reduce page weight and can improve loading metrics such as Core Web Vitals. Coywolf has argued that srcset works best when it is used for more than serving resized copies of the same image, and each version still benefits from good compression, modern formats such as WebP and lazy loading where appropriate.
srcset resources
Topic: Web development
Cite this definition
- APA
What is srcset? (2026, November 22). Glossary. https://glossary.io/srcset/
- MLA
“What Is srcset?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/srcset/.
- Chicago
“What Is srcset?” Glossary. Coywolf. November 22, 2026. https://glossary.io/srcset/.
- HTML link
<a href="https://glossary.io/srcset/">What is srcset?</a>
Published