AVIF vs WebP: which to use

Use AVIF when the smallest photo files matter more than encoding time, and WebP when you want something quicker to produce that older browsers also display. In our test at quality 82, AVIF was 30% smaller than WebP on 4000-pixel photos and took 5.5 times as long to encode. On screenshots the two were close, with AVIF 5% larger.

AVIF and WebP side by side

AVIF compared with WebP.
AVIFWebP
CompressionLossyLossy or lossless
TransparencyYesYes
AnimationYesYes
Browser supportSupported in Chrome, Firefox, Safari 16+, and Edge. Pre-2022 devices may not decode it.Supported by every evergreen browser since 2020 (Chrome, Firefox, Safari 14+, Edge). Older systems and some editing tools still struggle.
Kodak photo, 768×512, average sizemeasured49 KB63 KB
Photo 4000 px wide, average sizemeasured278 KB397 KB
Screenshot 2880×1800, average sizemeasured115 KB109 KB
Encode time, photo 4000 px widemeasured3.3 s598 ms
Decode time, photo 4000 px widemeasured351 ms43.6 ms

Measured rows: lossy formats at quality 82, which is the converter's default, in headless Chromium on one machine. Quality 82 is not the same visual quality in every format, and no quality metric was computed. Sizes are averages across each image set. Times are medians. Method and full results.

What we measured

Photographs favoured AVIF: 23% smaller than WebP on the Kodak set and 30% smaller at 4000 pixels wide. Screenshots did not: AVIF was 5% larger than WebP there.

AVIF cost more time in both directions. Encoding a 4000-pixel photo took a median of 3.3 s as AVIF and 598 ms as WebP, and that was with AVIF's encoder running on several threads. Decoding the result took 351 ms for AVIF and 43.6 ms for WebP with this site's decoders. A browser's built-in decoder may differ.

Why AVIF is slower

An AVIF file holds a single frame of AV1 video. AV1 gets its compression by trying many ways of predicting each block of the picture from its neighbours and keeping the cheapest. That search is the slow part. WebP is based on the older VP8 codec, which tries far fewer options.

When to use AVIF, and when to use WebP

Use AVIF when

  • You are serving many photographs and bandwidth or storage is the main cost.
  • Encoding happens once and the result is viewed many times.
  • Your audience is on current browsers.

Use WebP when

  • You are converting a lot of images and want it done quickly.
  • The images are mostly screenshots, UI or flat graphics.
  • You need to support Safari 14 and 15, which display WebP but not AVIF.

Convert between them

These run in your browser. The file is not uploaded.

AVIF vs WebP: common questions

For photo file size in our test, yes: 30% smaller on large photos at the same quality setting. For encoding speed and for older browsers, WebP is the better choice. For screenshots there was little between them.

Other format comparisons

Last updated