Menu

AVIF vs WebP: The Modern Image Format Showdown

7 min readPublished Updated

JPEG's successors have arrived in force. WebP, Google's 2010 format built on the VP8 video codec, became the pragmatic default for web images. AVIF, standardized in 2019 by the Alliance for Open Media on top of the AV1 codec, pushes compression substantially further. Both now enjoy support in every major browser — so which should you actually use?

The honest answer is 'it depends on what you're optimizing for.' Here's how they compare on compression, features, speed, and support — with the caveats benchmarks usually skip.

Compression: AVIF wins, especially at low bitrates

AVIF's headline advantage is compression efficiency. Across published comparisons, AVIF files typically come in around 50% smaller than equivalent-quality JPEGs, versus WebP's 25–34%. Put differently, AVIF is usually about 20% smaller than WebP for the same visual quality — and its lead grows at aggressive compression levels, where AVIF degrades gracefully into smooth softness while WebP and JPEG show blocking artifacts.

AVIF also handles the hard cases better: gradients (no banding, thanks to 10-bit and 12-bit support), dark scenes, and film grain synthesis. WebP's lossy mode is limited to 8-bit color with 4:2:0 chroma subsampling, which slightly blurs fine color detail — red text on dark backgrounds is a classic WebP weak spot.

Lossless is a different story

For lossless compression the ranking flips: lossless WebP is mature and typically beats lossless AVIF, often producing files ~25% smaller than PNG. If you need pixel-perfect graphics, WebP lossless is the stronger choice of the two.

Feature comparison

AVIF vs WebP capabilities
CapabilityWebPAVIF
Lossy compression vs JPEG~25–34% smaller~50% smaller
Lossless modeYes — excellentYes — weaker than WebP
TransparencyYesYes
AnimationYes — widely usedYes — less tooling support
Bit depth8-bit8, 10, and 12-bit
HDR & wide color gamutNoYes
Encode speedFastSlow (several times slower)
Progressive renderingNoNo (decodes all-at-once)
Browser supportUniversal since Safari 14 (2020)Chrome 85 (2020), Firefox 93 (2021), Safari 16 (2022+)

Speed and practicality: WebP wins

AVIF's compression comes from AV1, a video codec designed with enormous computational budgets in mind. Encoding an AVIF at good quality settings is several times slower than encoding WebP — sometimes an order of magnitude slower at the highest-effort settings. For a build pipeline processing thousands of product images, or a CMS converting uploads on the fly, that cost is real.

Decode speed matters too: AVIF is heavier to decode than WebP, which is itself heavier than JPEG. On low-end mobile devices, a page full of large AVIFs spends measurably more CPU time decoding images. Neither format supports true progressive rendering the way progressive JPEG does — a large image over a slow connection shows nothing until enough data arrives, rather than sharpening gradually.

Tooling outside the browser is the last practical gap. WebP is now readable by most image viewers and editors; AVIF support in desktop software, while improving, still lags. If your images will be downloaded and reused by others, WebP causes fewer support emails — and JPEG causes none.

So which should you use?

  • High-traffic websites where bandwidth and LCP dominate: AVIF first. The ~20% saving over WebP compounds at scale, and every current browser renders it.
  • Build pipelines where encode time matters, or images regenerate frequently: WebP. Much faster to produce, nearly as small.
  • Images with transparency for the web: either works; WebP if you also need broad tool support, AVIF if size is critical.
  • Pixel-perfect graphics (lossless): WebP lossless.
  • HDR photography for the web: AVIF — it's the only one of the two that can represent it.
  • Files people will download and open in other software: stick with JPEG or PNG entirely.

You don't have to choose just one

The HTML <picture> element lets you offer AVIF with a WebP or JPEG fallback, and the browser picks the best it supports. Most image CDNs (Cloudflare, Cloudinary, imgix) automate this content negotiation entirely — you upload one original and they serve the optimal format per visitor.

Converting your images

To experiment with either format — or to convert an AVIF or WebP you've downloaded back into something universally compatible — you don't need to install anything. FileMorf's converter handles WebP, AVIF, PNG, and JPG in the browser using the Canvas API: files are decoded and re-encoded locally, never uploaded. Convert a few of your own representative images at a few quality levels and compare; your images are a better benchmark than anyone's averages.

Command-line alternatives exist if you're scripting a pipeline: cwebp and avifenc are the reference encoders, and Sharp (Node.js) or ImageMagick handle both formats in batch. For one-off conversions, the browser is faster than installing any of them.

Free Tool

Convert images between formats free

Test WebP, AVIF, PNG, and JPG on your own images — converted client-side in your browser, no uploads.

Frequently asked questions

Is AVIF always smaller than WebP?

Not always, but usually — around 20% smaller at equivalent quality for typical photographic content, with a bigger lead at low quality settings. For lossless compression WebP generally wins. Results vary by image content, so test with your own images.

Do all browsers support AVIF now?

All current major browsers do: Chrome since version 85 (2020), Firefox since 93 (2021), and Safari since 16 (2022, with full support arriving in 16.4). Only very old browser versions lack it, which a <picture> fallback handles cleanly.

Should I replace all my JPEGs with AVIF?

For images served on your own website, converting to AVIF (or WebP) is usually worth it for the bandwidth and Core Web Vitals gains. For images you share, email, or archive, JPEG's universal compatibility still makes it the safer format.

What about JPEG XL?

JPEG XL compresses comparably to AVIF and supports progressive decoding and lossless JPEG recompression, but browser support remains the blocker — Safari added it, while Chrome declined to ship it. Until that changes, AVIF and WebP are the deployable choices.

Keep Reading