Chip in

AVIF vs WEBP

AVIF makes smaller files than WEBP — often 20–30% smaller again — and handles gradients and dark areas better. WEBP encodes far faster and is supported in more places, which for most sites still makes it the safer default.

Last updated

Choose AVIF when

  • Large hero images where the saving is worth the encoding time.
  • Photographs with skies, shadows or gradients, where WEBP shows banding.
  • Sites that can serve a fallback format alongside it.

Choose WEBP when

  • Anything that has to encode quickly or in bulk.
  • Broad compatibility with older browsers and software.
  • Images where the extra saving is a few kilobytes and not worth the complexity.

What AVIF actually is

AVIF is the smallest of the widely supported image formats, often half the size of a JPG that looks the same. It handles high dynamic range, wide colour, transparency and animation, and it degrades more gracefully than JPG when pushed hard.

Reading AVIF is nearly universal; writing it is not. A browser without an encoder quietly hands back a PNG instead of refusing, so the conversion looks as though it worked. Current Chrome on macOS is one of them. This site checks for a real encoder first and says so when there is none.

What WEBP actually is

WEBP does both jobs in one format: a lossy mode that beats JPG at the same visual quality, and a lossless mode that beats PNG. Unlike JPG it keeps an alpha channel, so a lossy image can still have a transparent background, which is the combination the web wanted for twenty years.

A WEBP renamed to .jpg still fails validation, because uploaders read the first bytes of the file rather than the name. Convert it properly.

AVIF and WEBP side by side

AVIF compared with WEBP
 AVIFWEBP
Extension.avif.webp
Media typeimage/avifimage/webp
CompressionLossyLossy
TransparencyYesYes
AnimationNoYes
Quality settingYesYes
We can write itYesYes

Questions

Is AVIF worth switching to?

For big images, yes. For thumbnails and interface graphics the saving is often a few kilobytes and the slower encode is not repaid.

Why is AVIF so slow to make?

It is a still frame of AV1 video, and AV1 encoders spend a lot of effort finding the smallest possible result. That work happens once; the download happens every time, which is the trade it is making.