Skip to content
ImageDoctor
Comparison6 min read

AVIF vs WebP: which modern image format should you use?

Both formats beat JPEG and PNG on the web. AVIF usually wins on file size for photos; WebP wins on speed, tooling and graphics. Most sites are best served by using each where it is strong.

Processed locally in your browser

For photographs on a website, AVIF usually gives the smaller file at the same visual quality. WebP is much faster to encode, is handled by more software outside the browser, and is the better choice for screenshots, graphics and big batches. A sensible default is AVIF for large photos with WebP or JPEG as a fallback, and WebP for everything else.

Both formats are supported by every current major browser, so the choice is less about whether people can see the image and more about file size, how long it takes to make, and what the image contains. The rest of this article goes through each of those, then shows how to try both on your own pictures.

AVIF and WebP at a glance

AVIFWebP
Built onA still frame of the AV1 video codecA still frame of the VP8 video codec (lossy) plus a separate lossless format
Typical strengthSmallest photos, smooth gradients, skin and skyFast encoding, screenshots and graphics in lossless mode
Colour depth8, 10 or 12 bits per channel; HDR and wide gamut8 bits per channel; lossy WebP always stores colour at quarter resolution (4:2:0)
TransparencyYesYes
AnimationYesYes
Progressive loadingNoNo
Full browser support (caniuse, 4 Nov 2026)About 96% of global usageAbout 97% of global usage
Encoding speedSlow: seconds for a large photoFast: usually milliseconds

The WebP limits come from Google's WebP FAQ, which also caps a WebP image at 16383 × 16383 pixels; support figures are from caniuse.com/avif and caniuse.com/webp, checked on 4 November 2026. Support figures change as people update their browsers, so check again if you are reading this much later.

Which one makes smaller files?

For photographs, AVIF usually does. MDN's image format guide summarises one published comparison on the same set of JPEG photos as a median 50% saving for AVIF against 30% for WebP (MDN, last modified 8 October 2026). Treat that as one test on one set of images, not a promise: the gap depends on the picture and on the quality you pick for each format.

AVIF's advantage is largest on smooth tones — skies, skin, studio backdrops — where JPEG and lossy WebP start to show banding or blocks. At aggressive settings AVIF tends to smooth fine texture away rather than show artefacts, which looks cleaner but is still lost detail, so compare at 100% zoom before you settle on a quality.

For screenshots, diagrams, logos and anything with small text, the comparison changes. Lossy encoding of either kind blurs sharp edges and coloured text, and MDN advises lossless encoding for that kind of image. Lossless WebP is well established for it; for flat graphics, PNG or an SVG may be just as small. Our lossy vs lossless explainer covers why.

How long does each take to make?

This is where WebP is clearly ahead. Browsers that can write WebP do it with their own built-in encoder, which is quick. No current browser can write AVIF from a canvas, so tools that run in the browser — ImageDoctor included — have to bring their own AVIF encoder.

  • WebP in ImageDoctor uses your browser's own encoder. The WebP option only appears where the browser can actually produce one.
  • AVIF in ImageDoctor uses libavif compiled to WebAssembly. The encoder (about 3.5 MB) downloads the first time you save an AVIF, and encoding runs on your device. Images up to 4 megapixels are encoded at speed 6, up to 12 MP at speed 8, and anything larger at 9, trading a little compression for an encode that finishes.
  • Lossy AVIF is saved with colour at quarter resolution (4:2:0), the usual choice for photos. Quality 100 switches to lossless with full-resolution colour (4:4:4).

For one hero image the extra seconds don't matter. For a folder of 300 product photos, or images generated on a server for every upload, WebP's speed is a real advantage.

Can everyone see them?

In a browser, almost everyone. MDN lists AVIF support from Chrome 85, Edge 121, Opera 71, Firefox 93 and Safari 16.1; WebP has been supported for longer. Outside the browser it is patchier: some older desktop apps, operating systems and upload forms still refuse AVIF, and a few refuse WebP. If you are sending a picture to a person or a system you don't control, JPEG is still the safe choice.

On a website, MDN still recommends offering a fallback, which costs nothing: list the formats in order inside a <picture> element — a <source type="image/avif">, then a <source type="image/webp">, then an ordinary <img src="photo.jpg">. Each browser takes the first one it understands.

Search engines are not a reason to avoid either. Google's image guidelines list both WebP and AVIF among the formats Google Search supports (Google Search Central, checked 4 November 2026).

Which should you use?

ImageUseWhy
Large photos: hero images, galleries, product shotsAVIF, with WebP or JPEG as fallbackThe biggest images gain the most bytes, and there are only a few of them to encode
Everyday photos in bulkWebPMost of the saving over JPEG, at a fraction of the encoding time
Screenshots, UI, text, diagramsLossless WebP or PNG; SVG if it is vectorLossy encoding blurs sharp edges in either format
Photos with HDR or wide colourAVIFWebP is limited to 8-bit colour
Anything you email or upload elsewhereJPEGAccepted everywhere

Whichever you pick, resizing to the size the page actually displays usually saves more than the format change. A 4000-pixel photo shown at 1200 pixels wide is mostly wasted bytes in any format. Our guide to optimising images for a faster website puts the two together.

Try both on your own images

  1. Open the Image ConverterAdd a few typical photos to the Image Converter. They are processed in your browser and not uploaded to ImageDoctor.
  2. Export as WebP, then as AVIFChoose WebP as the output and note the sizes, then switch to AVIF. The converter starts at quality 85 for both; lower each until you can just see a difference at full size.
  3. Compare at 100% zoomLook at skies, faces, fine texture and any text. Keep the smaller file only if it still looks right.

For a single JPEG there is also a dedicated JPG to AVIF converter. To resize, re-encode and strip metadata in one pass, the Image Optimizer picks WebP automatically where your browser can write it.

Common questions

For photographs, AVIF usually makes a smaller file at the same visual quality. WebP encodes much faster, works in more software outside the browser and suits screenshots and graphics in its lossless mode. Many sites use AVIF for large photos and WebP for the rest.

Not by converting the WebP files themselves: each lossy re-encode loses a little more detail. Make AVIF from the original JPEG or PNG instead, and only for the large photos where the saving is worth the slower encode.

Yes, both do, so either can replace a transparent PNG on a website. JPEG is the one that can't.

Yes. Google's image guidelines list both among the supported formats, alongside JPEG, PNG, GIF, BMP and SVG (checked 4 November 2026).

Tools in this article

Format reference

All blog