HTML decoding Attribute
The decoding attribute hints whether the browser should decode an image together with the rest of the page (sync) or separately (async).
Description
The decoding attribute of the <img> element is a hint about how the browser should decode the image before showing it. Decoding converts the compressed file into pixels and can take noticeable time for large images.
async lets the browser decode the image off the main thread and show other content first, which can make the page feel more responsive. sync decodes it together with the rest of the content, so the image appears at the same time as the surrounding text. auto (the default) leaves the choice to the browser. Modern browsers already decode most images asynchronously, so the attribute has a small effect in practice.
Syntax
<img src="URL" decoding="sync | async | auto">
Values
- syncDecode the image synchronously, along with other content.
- asyncDecode the image asynchronously, so other content can be shown first.
- autoThe default. No preference; the browser decides.
Applies To
Example
Browser Support
The following information will show you the current browser support for the HTML decoding attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.
Desktop





Tablets & Mobile





