Report

Help us improve this tool

Srcset Generator

Build img srcset and sizes attributes from width lists and filename patterns.

O M T

Generate responsive image srcset and sizes markup

Responsive images let browsers download an appropriate resolution for the viewport. The srcset attribute lists candidate URLs with width descriptors (320w, 640w, …), while sizes tells the user agent how wide the image renders at different breakpoints.

Filename patterns

Provide a URL or filename pattern with a {w} placeholder, or a basename such as hero.jpg to append -{width} before the extension. List target widths in pixels separated by commas.

The default src uses the largest width entry, which matches common lazy-loading setups where the browser still needs a fallback URL.

Frequently Asked Questions

What is the difference between srcset and sizes?

srcset enumerates available files and their intrinsic widths. sizes describes layout width so the browser can pick the smallest adequate resource.

Should I enable lazy loading?

loading="lazy" defers off-screen downloads. Pair it with decoding="async" when you do not need synchronous decode for hero images above the fold.

Does this resize images?

No. The tool only emits HTML. Generate derivative files with your build pipeline or CDN image service, then paste the width list here.