WebP vs AVIF: which format should your website use?

AVIF makes smaller photos; WebP has slightly wider support. Here is when to use each, with real file sizes from 54 photos and current browser data.

By
Picture Optimizer team
Published
Type
Comparison

Use AVIF for photos when you can serve a fallback, and WebP when you need one modern format that works almost everywhere without extra markup. AVIF usually makes smaller files at the same visual quality: in our test of 54 photos it was 39.2% smaller than WebP in total. WebP's browser support is slightly wider.

The short comparison

WebP

AVIF

Lossy and lossless

Both

Both

Transparency

Yes

Yes

Animation

Yes

Yes

Global browser support (caniuse, October 2026)

About 97%

About 96%

Typical photo size in our test

26.7 MB for 54 photos

16.2 MB for the same 54 photos

WordPress upload support

Since WordPress 5.8

Since WordPress 6.5, if the server's image library supports it

Feature rows come from MDN's image format guide, which also notes that AVIF does not support progressive rendering; support figures from caniuse; WordPress versions from the WordPress core developer notes.

Which is smaller?

We encoded 54 business photos (free-license Unsplash images) at 2,048 px wide with the same High preset: WebP at quality 82, AVIF at quality 55. Each encoder has its own quality scale, so the two numbers are not directly comparable; they are simply the tool's High preset for each format.

  • WebP total: 27,945,242 bytes (26.7 MB)
  • AVIF total: 17,003,431 bytes (16.2 MB)
  • AVIF was smaller for all 54 photos.

Method: 1 − (17,003,431 ÷ 27,945,242) = 39.2%. The AVIFs scored an SSIM of 0.9908 or higher against the original at the same size, where 1.0 means identical. We did not measure SSIM for the WebP versions, so treat this as a size comparison at matched settings, not a strict quality-matched benchmark.

One more finding: WebP was not reliably smaller than JPEG. At these settings it was larger than the JPEG for 20 of the 54 photos and only 1.5% smaller in total. That is worth testing on your own photos before assuming a switch to WebP saves much.

Which has better browser support?

Both are safe for most audiences now. According to caniuse, full AVIF support arrived in Chrome 85, Firefox 93, Edge 121, Safari 16.0 on iOS and Safari 16.4 on macOS (16.1 to 16.3 on macOS were partial). WebP has full support from Chrome 32, Firefox 65, Edge 18, Safari 14 on iOS and Safari 16.0 on macOS.

The practical gap is a small share of older Safari and Edge installs. If those visitors matter to you, use a fallback.

How to serve AVIF with a fallback

The picture element lets the browser pick the first format it supports:

```html
<picture>
<source type="image/avif" srcset="cafe-counter.avif">
<source type="image/webp" srcset="cafe-counter.webp">
<img src="cafe-counter.jpg" alt="Barista pouring milk at a café counter" width="1600" height="1067">
</picture>
```

MDN recommends exactly this pattern when using AVIF. A CDN or plugin that picks the format per request can do the same job without changing your HTML.

When WebP is the better choice

  • Your platform or CMS accepts WebP but not AVIF uploads. Shopify's help center, for example, lists WebP among accepted product image types but does not list AVIF.
  • Your server's image library lacks AVIF support. WordPress 6.5+ shows this under Tools > Site Health > Info > Media Handling.
  • You need one file per image and can't add fallback markup.

When AVIF is the better choice

  • Photo-heavy pages where bytes matter: galleries, product grids, blog posts with large images.
  • You can add a fallback, or your tooling does it for you.
  • You want the smallest files at a quality you've checked by eye.

Convert from the original, not from WebP

If you already serve WebP and want AVIF, encode the AVIF from your original JPEG or PNG when you still have it. Converting a lossy WebP to AVIF compresses an already compressed image, so artifacts from the first pass are carried into the second.

Try both on your own photos

Our WebP to AVIF converter and JPG to AVIF converter run the same preset as the test above. The Free plan exports AVIF or JPG for your first 15 photos, once; WebP output starts on Starter. To convert a folder at a time, see batch convert.

Keep reading

Sources

Questions

Short answers to what people ask about this.

For photographs, AVIF usually produces smaller files at similar quality. In our test of 54 photos at the same preset, AVIF was smaller than WebP for every photo and 39.2% smaller in total. WebP has slightly wider browser support.