Favorites

HTML decoding Attribute

decoding
HTML AttributeThis attribute is supported by all modern browsers.
Updated 22nd November 2026

The decoding attribute hints whether the browser should decode an image together with the rest of the page (sync) or separately (async).

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

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

<img src="https://picsum.photos/id/1015/400/250" alt="Mountain river" decoding="async">
Open in editor

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.

This attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.