About this tool
Image Srcset Generator writes the HTML for a responsive image. Enter the base image path, a comma-separated list of widths and the alt text, and it produces an img tag with src, srcset, sizes and alt attributes, ready to copy.
File names are built by inserting a -{width}w suffix before the extension, so /img/hero.jpg with 320, 640 and 1280 gives hero-320w.jpg, hero-640w.jpg and hero-1280w.jpg, each with a matching w descriptor. Widths are read as whole numbers, sorted from smallest to largest, and duplicates, zeros and non-numeric entries are dropped. The src fallback is the largest file, and sizes is set to (max-width: Wpx) 100vw, Wpx using that largest width. A dot in a folder name is not mistaken for an extension, and a path without an extension simply gets the suffix at the end.
The tool only writes markup: you still have to create and upload the resized files with those names, and you should adjust sizes to match your real layout. Double quotes in the alt text are escaped, but other special characters are left as typed. Nothing is uploaded; it runs in your browser.