Tested tool guide
Tested browser tools
Checked August 16, 2026
What Picture Element Generator does, with a checked example
This tool assembles the markup for the HTML picture element. You supply the image files you have per format and per breakpoint, and it returns the picture block that serves them: a source element for each combination, ordered so the browser can pick one, with a closing img as the fallback. The thing people most often get wrong: the browser does not weigh your sources and choose the best. It walks the list from top to bottom and takes the first source whose media query matches and whose type it can decode, so the order the generator produces is what decides which file actually renders.
Worked example
A concrete input and expected output from the current implementation.
Input
1200px and wider: banner-1200.webp, banner-1200.jpg. Below 1200px: banner-800.webp, banner-800.jpg. Alt text: Product launch banner.
->
Expected output
<picture>
<source media="(min-width: 1200px)" srcset="banner-1200.webp" type="image/webp">
<source media="(min-width: 1200px)" srcset="banner-1200.jpg" type="image/jpeg">
<source srcset="banner-800.webp" type="image/webp">
<img src="banner-800.jpg" alt="Product launch banner">
</picture>
Each breakpoint pairs the newer format first, so browsers that can decode WebP never download the JPEG. The last source has no media query, so it serves every viewport below 1200px, and the img element is the final fallback for browsers without picture support while carrying the alt text.