Image SEO

WebP vs AVIF: Choosing a Next-Gen Image Format

wtfi_editor
wtfi_editor Published July 6, 2026 • 4 min read
WebP vs AVIF: Choosing a Next-Gen Image Format

You export a hero photo as JPEG, look at the file size, and wince. So you re-export it as WebP and it drops meaningfully. Then someone on the team says you should be using AVIF instead, and now you’re stuck in a format argument that has been running in one form or another since 2020.

Here’s the honest version: both are good, both are widely supported in modern browsers, and the gap between them matters far less than the gap between either and the unoptimized JPEG you’re shipping today. But there are real trade-offs, and they’re not the ones people argue about.

What each format actually is

WebP came out of Google and is built on the VP8 (and later VP9) video codec’s intra-frame coding. It handles lossy and lossless compression, alpha transparency, and animation. It has been in every major browser for years now, and tooling for it is everywhere — every CDN, every CMS, every image library speaks WebP without complaint.

AVIF is derived from AV1, a much newer video codec, and it inherits AV1’s more sophisticated compression machinery. It supports alpha, animation, wide color gamut, and higher bit depths. Browser support is broad across current versions of the major engines, though it arrived later than WebP and older devices in the wild are more likely to miss it.

The compression picture, without invented numbers

The qualitative shape is well established and you can verify it on your own images in an afternoon: at comparable perceived quality, AVIF generally produces smaller files than WebP, and both generally beat JPEG. That ordering holds often enough to plan around.

What it doesn’t tell you is how much, on your images. The gap swings wildly by content. Large, soft, low-detail images — gradients, skies, blurred backgrounds, flat illustration — are where AVIF pulls away hardest. Dense, noisy, high-frequency photographs narrow the gap. Small images (thumbnails, icons, avatars) can be a wash or even go the other way once container overhead is factored in.

So don’t take anyone’s percentage, including one you read in a blog post. Run twenty representative images from your own library through both encoders at a few quality settings and compare. That’s a real measurement; a figure from someone else’s test corpus is not.

The trade-offs nobody mentions in the benchmark posts

Encode time

AVIF encoding is expensive — noticeably slower than WebP, sometimes dramatically so at high effort settings. If you transcode on upload at heavy publishing volume, that’s a real infrastructure cost and a real latency problem. WebP encodes fast enough to ignore.

Quality scales aren’t comparable

Quality 80 in one encoder is not quality 80 in another. Don’t port your JPEG quality settings across and assume parity. Tune per format, by eye, on real content.

AVIF gets mushy before it gets blocky

Push JPEG too far and you get blocking and ringing — ugly, but legible as damage. Push AVIF too far and it smooths detail away instead: skin texture, fabric weave, and fine foliage quietly dissolve. It looks clean at a glance and wrong on inspection. Watch this on portraits and product shots.

You probably don’t have to choose

The format war framing is mostly a false one, because <picture> lets you serve both and let the browser decide:

<picture>
  <source type="image/avif" srcset="hero.avif">
  <source type="image/webp" srcset="hero.webp">
  <img src="hero.jpg" alt="..." width="1600" height="900">
</picture>

The browser takes the first type it supports and ignores the rest. The <img> at the bottom is the fallback and the element that carries your alt, width, height, and loading attributes. Add srcset with width descriptors inside each <source> and you’ve solved format and resolution together.

If that’s more markup than you want to hand-author, most image CDNs negotiate format server-side from a single URL. That’s usually the right answer for a content site.

A decision you can act on

If you’re on a modern CDN or a CMS with a decent image pipeline: enable AVIF with WebP fallback and stop thinking about it. The infrastructure absorbs the encode cost and you get the best available format per visitor.

If you’re hand-managing files, building static, or working with a constrained pipeline: WebP alone is a completely defensible choice. It’s simpler, faster to encode, and captures most of the win. Shipping good WebP beats shipping AVIF you never got around to generating.

Either way, format is one lever among several. Correct dimensions, sensible srcset breakpoints, and a smart loading strategy typically move real-world numbers more than a codec swap does — worth reading alongside the rest of our image SEO coverage. And if you’re sourcing from free libraries, check what you’re actually downloading first: many still hand you an oversized JPEG that needs processing regardless of which free image source it came from.

Related Articles

The Ultimate Guide to Alt Text for Images
Image SEO

The Ultimate Guide to Alt Text for Images

Master the art of writing descriptive alt text to boost your accessibility and SEO — with real examples of good versus bad…

The Ultimate Guide to Alt Text for Images