AVIF vs WebP: Why AVIF Compresses Better
For a few years, WebP was the easy answer to "what's the smallest format I can safely use?" That's no longer quite true. AVIF, which has been quietly gaining support since 2020, now beats WebP on pure compression in most real-world tests — and the main reason people still avoid it (creating one was awkward) isn't really true anymore either.
Why AVIF compresses better
WebP is built on VP8, a video codec from 2010. AVIF is built on AV1, a video codec finished a decade later — and video codecs are where image compression research actually happens, since even a 1% improvement matters enormously at streaming scale. AV1 brought meaningfully better tools for predicting and encoding blocks of pixels, and AVIF inherits all of it.
In practice, that shows up as:
- Smaller files at the same visual quality. Independent tests (and our own, compressing the same photos both ways) consistently land in the 20–30% range in AVIF's favor, with photos and complex images seeing the biggest gains.
- Better handling of smooth gradients. AVIF supports higher bit depth and has stronger tools for avoiding "banding" — the visible stepping you sometimes see in skies or shadows — at a given file size.
- Wider color support. AVIF can represent HDR and wide-gamut color, which WebP can't. Not something most people need day to day, but it matters for photography-heavy sites.
Both formats support transparency and both have lossy and lossless modes, so that part isn't a differentiator.
The catch that isn't really a catch anymore
Here's the thing that's kept AVIF from being the obvious default: every modern browser can display an AVIF file without any trouble, but creating one directly in a browser only ever worked reliably in Chrome and Edge. Firefox and Safari never shipped a native AVIF encoder — so tools that rely on the browser's own canvas to do the conversion simply produce a different (or broken) result there, or grey out AVIF as an option entirely.
That's a real limitation, but it's a limitation of that specific approach, not of AVIF itself. img-compress doesn't rely on the browser's built-in encoder — it runs its own AVIF encoder, compiled to WebAssembly, the same way it processes every other format. The result: AVIF conversion that works identically in Chrome, Firefox, Safari, or Edge, entirely on your device, with nothing uploaded anywhere.
When AVIF is worth it
- You want the smallest possible file for a photo, and you're not in a rush — AVIF is the best option available today.
- You're archiving or storing images where saved space matters more than encoding speed.
- You're publishing to the web and want the leanest page weight — since every modern browser can display AVIF, there's no compatibility risk on the viewing side.
Where WebP still earns its place: if you're converting a very large batch of images and want the fastest turnaround, WebP's simpler encoder gets there quicker, at a modest size cost. For most one-off or moderate-batch use, though, the extra few seconds AVIF takes is a small price for a noticeably smaller file.
Trying it yourself
You can compress and convert to AVIF — along with JPG, PNG, and WebP — directly in your browser with img-compress. Nothing gets uploaded to a server, and it works the same no matter which browser you're using. If you're deciding between formats more broadly, WebP vs JPG vs PNG vs AVIF covers the full picture.