The Two Formats Quietly Replacing JPEG
Somewhere in the last few years, the images on the web stopped being JPEGs and PNGs. You just didn't notice, because your browser handled it silently.
Right-click almost any photo on a modern website and hit "Save image as," and you'll increasingly get a file ending in `.webp` or `.avif` instead of the `.jpg` you expected. Both formats exist for the same reason — JPEG is 30 years old and wastes bandwidth — and both do a genuinely better job. But they are *not* the same tool, and picking the wrong one means either bloated files or images half your users can't open.
Here's the honest, no-marketing comparison: what each format actually is, where each one wins, and how to decide which belongs in your workflow.
What They Actually Are
WebP was released by Google in 2010. It's built on the compression brains of the VP8 video codec, and it does one job extremely well: shrink web images below what JPEG and PNG can manage while keeping them looking the same. It supports transparency (like PNG), animation (like GIF), and both lossy and lossless compression. After a slow start, it's now supported basically everywhere.
AVIF is the newer challenger, arriving around 2019. It's a single still frame pulled out of AV1, a cutting-edge royalty-free video codec built by the Alliance for Open Media — Google, Netflix, Amazon, Microsoft, and Mozilla all had a hand in it. AVIF inherits AV1's obsessive, modern compression, plus HDR and wide color gamut support that WebP simply doesn't have.
The one-line version: WebP is the safe, universal upgrade to JPEG. AVIF is the smaller, sharper, slightly-less-supported upgrade to WebP.
Round 1: File Size
This is the headline fight, and AVIF wins it.
For the same visible quality, a typical photo comes out roughly like this:
AVIF is especially good at two things WebP struggles with: smooth gradients (skies, soft shadows) without ugly banding, and holding detail at very low file sizes. If you crank the compression aggressively, WebP starts smearing first.
For a photography portfolio, a media-heavy homepage, or anywhere you're serving thousands of images, that extra 20–30% off WebP is real money in bandwidth and real seconds off load time.
Winner: AVIF, and it's not particularly close on photos.
Round 2: Browser & App Support
This is where WebP quietly takes the belt back.
WebP has been supported in every major browser — Chrome, Firefox, Safari, Edge — for years, and it opens in most current image editors and OS photo viewers. If you serve a WebP, essentially everyone sees it.
AVIF support arrived later and is still catching up in the places that aren't browsers. Modern Chrome, Firefox, and recent Safari all render AVIF fine. But the moment you leave the browser, things get shaky: older photo editors choke, some social platforms won't accept an AVIF upload, email clients are hit-or-miss, and plenty of desktop apps still stare at the file blankly. (If you've ever downloaded an AVIF and had your editor refuse it, that's exactly this gap — and the fix is a quick AVIF to PNG or AVIF to JPG conversion.)
Winner: WebP, by a comfortable margin — especially outside the browser.
Round 3: Encoding Speed
Nobody talks about this one until it bites them.
WebP encodes fast. You can batch-convert a folder of images and barely notice. AVIF, because it's doing far more sophisticated compression, is *slow* to encode — sometimes dramatically so at the highest quality settings. Decoding (i.e. the user's browser displaying it) is fine; it's the *creating* that costs CPU.
For a one-time export, who cares. But if you're generating images on the fly, resizing user uploads in real time, or processing thousands of files in a build step, WebP's speed advantage matters a lot.
Winner: WebP for anything at scale or in real time.
Round 4: Transparency, Animation & Special Cases
Both formats support alpha transparency, so both can replace PNG for logos and cut-outs. Both can animate, so both can replace bloated GIFs.
The tiebreakers:
So Which One Should You Actually Use?
Use WebP when:
Use AVIF when:
The pro move: serve AVIF with a WebP fallback and a JPEG fallback under that, using the HTML `
```

```
That's the setup big sites use. You get AVIF's file size where it works and WebP's ubiquity everywhere else.
Getting the Files
You don't need a build pipeline to experiment. If you already have WebP images and want to see how much smaller AVIF gets them, run them through WebP to AVIF. Starting from originals? Convert straight from JPG to AVIF or PNG to AVIF and compare the byte counts yourself.
And when you hit that inevitable moment where some app refuses to open an AVIF you downloaded, AVIF to PNG turns it back into something universal in about ten seconds.
Bottom Line
WebP and AVIF aren't rivals so much as two rungs on the same ladder. WebP is the reliable one — smaller than JPEG, opens everywhere, encodes fast, and asks nothing of you. AVIF is the ambitious one — smaller still, sharper on gradients, better color — but it's pickier about where it'll open and slower to create.
If you can only pick one and want zero headaches, pick WebP. If you're chasing every last kilobyte for a photo-heavy site and you're willing to set up fallbacks, layer in AVIF on top.
The one thing you shouldn't do is keep shipping full-size JPEGs and PNGs in 2026. Both of these formats will make your images smaller and your pages faster — the only question is how much of each you want.