Skip to content
Private: files never leave your device

AVIF vs WebP: Which One Should You Use?

Both formats replace JPG and PNG on the web, both handle transparency and animation, and both now open in every major browser. They differ in file size, encoding speed, maximum dimensions and how well they handle lossless graphics. This guide compares them with our own encoding test and the official specifications, so you can pick the right one for each image.

AVIF usually gives smaller lossy photos, WebP usually gives smaller lossless graphics and encodes many times faster, and WebP images are limited to 16,383 pixels on each side

For most websites, AVIF is the better choice for lossy photos because it usually makes smaller files, and WebP is the better choice for lossless graphics, very large images and anything you must encode quickly. Both now work in Chrome, Edge, Firefox and Safari, so the safest setup is AVIF first, WebP second and JPG or PNG as the fallback. The figures below come from MDN, Google, the AOMedia AVIF specification, caniuse and our own test, all checked on 24 November 2026.

AVIF and WebP side by side

FeatureAVIFWebP
Based onAV1 video codec in a HEIF containerVP8 video codec (lossy) and its own lossless format
Lossy and losslessBothBoth
TransparencyYesYes
AnimationYesYes
Bit depth8, 10 and 12 bit8 bit (MDN lists 8-bit ARGB for lossless)
HDR and wide colour gamutYesNot listed by MDN
Largest imageSet by the AVIF profile; bigger pictures are stored as a grid of tiles16,383 x 16,383 pixels
MIME typeimage/avifimage/webp
Global browser support (caniuse)96.71 percent97.32 percent

MDN sums it up on its image format guide: AVIF offers slightly better compression than WebP, but it does not support progressive rendering, and WebP is supported a little more widely. Google says lossy WebP files are 25 to 34 percent smaller than comparable JPEGs at the same SSIM quality, and lossless WebP files are 26 percent smaller than PNGs. MDN reports that, for the same set of JPG images, AVIF reached a median saving of 50 percent against 30 percent for WebP.

Our test: three images, five settings

To see how the gap looks in practice, we encoded three images with the same encoders our Compress Image tools use in your browser: MozJPEG, libwebp and libavif, compiled to WebAssembly. Two were flat illustrations from this site, each 1,200 x 630 pixels, and one was a 1,200 x 800 pixel test pattern of smooth gradients with random noise, which behaves more like grainy photo detail. Sizes are in bytes.

SettingIllustration AIllustration BGradient and noise
Original PNG222,88757,312not saved as PNG
JPG quality 7544,78242,34677,595
WebP quality 7531,07029,640131,788
AVIF quality 5018,57514,63525,619
WebP lossless178,02823,210991,902
AVIF lossless349,88586,5351,672,804

Three patterns stand out. In lossy mode AVIF was the smallest every time, about 40 to 50 percent smaller than WebP on the illustrations. In lossless mode WebP won every time, and AVIF lossless files were roughly two to almost four times bigger. On the noisy image WebP at quality 75 was even bigger than the JPG, because noise is the hardest thing for its VP8 codec to compress, while AVIF kept it small.

Quality numbers are not the same scale Quality 75 in WebP and quality 50 in AVIF do not mean the same visual quality, and we did not score the images with a metric such as SSIM. Treat these sizes as a guide, and compare your own images by eye at the size you will show them.

Encoding speed: where WebP clearly wins

In the same test, each lossy WebP took between 68 and 163 milliseconds to encode, while each lossy AVIF took between 1.2 and 3.0 seconds, at the encoder speed setting of 6 out of 10. That is roughly 10 to 40 times slower. For a handful of hero images it does not matter, but for a shop that converts thousands of product photos on upload, or a server that resizes images on the fly, AVIF encoding can become the slowest step. Decoding in the browser is not part of this test.

When to choose AVIF

  • Large photos on landing pages, blogs and galleries, where every kilobyte affects loading time.
  • HDR or wide colour images, since the AVIF specification supports HDR, wide colour gamut and 10 or 12 bit depth, which WebP does not offer.
  • Images with smooth gradients, such as skies and studio backgrounds, which show banding more easily at 8 bit.
  • Animations that would otherwise be large GIFs, because MDN lists AVIF as a good choice for animated images.

When to choose WebP

  • Screenshots, logos, charts and UI graphics saved losslessly, where WebP gave the smaller files in our test.
  • Very wide or tall images, up to WebP's limit of 16,383 pixels on each side. Google's FAQ explains the limit comes from 14 bits being used for width and height.
  • Bulk or on-the-fly conversion, where encoding time and server cost matter more than the last few kilobytes.
  • Older browsers and apps. caniuse lists full WebP support from Chrome 32, Firefox 65 and Safari 16, compared with Chrome 85, Firefox 93 and Safari 16.4 for AVIF.

Browser support in detail

BrowserAVIF full support fromWebP full support from
Chrome8532
Edge12118
Firefox9365
Safari on Mac16.4 (16.1 to 16.3 partial)16.0 (14 to 15.6 partial)
Safari on iPhone and iPad16.014

Browser support is no longer the reason to avoid AVIF, but outside the browser it is a different story. Email programs, some content management systems, office apps and older photo viewers may not open either format. Keep a JPG or PNG copy for downloads and attachments, and convert received files with AVIF to JPG or WebP to JPG when an app refuses them.

Use both with a fallback

You do not have to pick only one. The picture element lets the browser choose the first format it supports, which is the approach MDN recommends:

<picture>
  <source srcset="photo.avif" type="image/avif">
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="Describe the photo" width="1200" height="800">
</picture>

Put AVIF first so browsers that support it download the smallest file, then WebP, then the JPG that every browser can show. Keep the width and height on the img tag so the page does not jump while images load.

How to make the files

  1. Convert photos with JPG to AVIF and JPG to WebP, or graphics with PNG to AVIF and PNG to WebP.
  2. Compare the two versions at the size they will appear on the page, not zoomed in.
  3. Shrink them further with Compress AVIF or Compress WebP if a quality slider gives you room.
  4. Already have WebP files and want to try AVIF? AVIF to WebP and WebP to AVIF convert between them.

Every converter runs in your browser, so your images are not uploaded. For the older formats, see our comparison of JPG, PNG and WebP.

Sources and dates

PageReadUsed for
MDN: Image file type and format guide24 November 2026Features, bit depth, progressive rendering, median 50 and 30 percent savings, picture fallback
Google: WebP24 November 2026WebP size savings against PNG and JPEG
Google: WebP FAQ24 November 202616,383 pixel limit and 14-bit dimensions
AOMedia: AV1 Image File Format specification24 November 2026AV1 in HEIF, HDR and wide colour gamut support, grid images
caniuse: AVIF and caniuse: WebP24 November 2026Browser versions and global support

Frequently asked questions

Is AVIF better than WebP?

For lossy photos usually yes, because AVIF files are often much smaller at similar quality. WebP is better for lossless graphics, very fast encoding and images larger than AVIF profiles comfortably handle.

Is AVIF smaller than WebP?

In lossy mode it usually is. In our test AVIF was about 40 to 50 percent smaller than WebP on two illustrations, but in lossless mode WebP files were two to four times smaller.

Do all browsers support AVIF?

All current major browsers do. caniuse lists full support from Chrome 85, Edge 121, Firefox 93 and Safari 16.4, about 96.7 percent of users worldwide.

Should I use AVIF or WebP for WordPress or a shop?

Use AVIF for large photos if your platform can create it, with WebP or JPG as a fallback. If uploads must be converted quickly in bulk, WebP is simpler and much faster to encode.

Why is AVIF so slow to create?

AVIF is built on the AV1 video codec, and its encoder does much more work per image than the WebP encoder. In our test lossy AVIF took 10 to 40 times longer to encode than WebP.