All guides
Image·6 min read·

WebP vs AVIF: Which Image Format Should You Choose?

Both are modern image formats that beat JPEG and PNG. WebP has near-universal browser support and is fast to encode. AVIF compresses tighter but encodes slower. Here's how to choose.

WebP and AVIF are the two modern image formats fighting for the post-JPEG / post-PNG slot. Both produce smaller files than the formats they replace, both support transparency, both work in modern browsers. The right choice depends on three factors: how aggressive you need the compression, how fast you need encoding, and which browsers your audience uses.

Quick verdict

Use case Pick
Photographs on the web (general) WebP
Maximum compression, audience on modern browsers AVIF
Building a responsive <picture> element with fallbacks Both (AVIF first, WebP second, JPEG fallback)
Encoding many images quickly (build pipelines) WebP
Images for marketing emails JPEG (neither WebP nor AVIF has good email-client support yet)

Why WebP wins on practicality

WebP launched in 2010 and has had time to bake into the web ecosystem. As of 2026, WebP is supported in 97%+ of browsers in active use worldwide — Chrome, Edge, Firefox, Safari (since 2020), all the mobile browsers. Server-side encoders are mature and fast; the open-source cwebp tool encodes a typical photograph in well under a second.

For most use cases, the file-size win over JPEG (~25–35% smaller at the same perceived quality) is more than worth the small loss in tooling support outside browsers. If you're shipping images to a website and the audience is on browsers, WebP is the boring correct answer.

Why AVIF wins on compression

AVIF (AV1 Image File Format) launched in 2019 and uses the AV1 video codec for still-image compression. It's significantly more efficient than WebP — typically another 20% smaller at the same perceptual quality. A 100 KB WebP becomes an 80 KB AVIF.

The catch: AVIF encoding is slow. The same image that takes 200 ms to encode as WebP can take 5–15 seconds as AVIF. For a one-off image you're going to publish on a hero section, that's fine. For a build pipeline encoding thousands of images, the latency adds up.

Browser support for AVIF is also younger. Chrome 85+, Firefox 93+, Safari 16.4+ (May 2023). Older Safari versions (still on phones from 2020) won't decode AVIF; you need a fallback.

How to ship both

The standard pattern: use a <picture> element to give the browser a choice. Browsers pick the first format they support, falling back through the alternatives:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Hero image">
</picture>

This serves AVIF to Chrome 85+ and Safari 16.4+, WebP to slightly older browsers, JPEG to anything that doesn't support either. The trade-off is build pipeline complexity — you're now generating three formats per image.

If you don't want the build pipeline complexity, pick one format and stick with it. WebP for general use; AVIF if you're optimizing for cutting-edge browsers and don't mind the slow encode.

Compression comparison (real numbers)

A 12-megapixel phone photo (Sony A7 RAW exported at 100% quality):

  • JPEG quality 90: 4.2 MB
  • WebP quality 85: 2.6 MB (38% smaller)
  • AVIF quality 75: 1.6 MB (62% smaller)

The same image at the threshold where compression artifacts become visible to a human:

  • JPEG quality 60: 1.1 MB (artifacts visible)
  • WebP quality 60: 700 KB (artifacts subtle)
  • AVIF quality 50: 420 KB (artifacts subtle)

AVIF's compression advantage shows up most strongly at low bitrates. At very high quality settings, the gap narrows.

When neither wins

Photographs going to print, archival images, anything where you'll re-edit later — keep the lossless or high-quality JPEG/PNG/TIFF version as your master, and only convert to WebP/AVIF when distributing. Each round of lossy re-encoding loses information; you don't want to be re-compressing the WebP back to a JPEG at quality 80 and then to a smaller WebP a year later.

Tools to convert

My honest take

If I'm building a marketing site or blog today, I use WebP for everything. It's a lossless win over JPEG/PNG with no real downsides. If I'm building an app where image bandwidth is a meaningful cost (e.g., social media app with millions of images), I use both in a <picture> tag and pay the build complexity tax.

I don't use AVIF as my only format yet — Safari 15 and earlier still represents enough traffic on most sites that ignoring those users isn't free.

Tools mentioned in this guide

Related guides

We use cookies to understand how you use Dropvert and improve the experience.