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
| Capability | WebP | AVIF |
|---|---|---|
| Lossy compression vs JPEG | ~25–34% smaller | ~50% smaller |
| Lossless mode | Yes — excellent | Yes — weaker than WebP |
| Transparency | Yes | Yes |
| Animation | Yes — widely used | Yes — less tooling support |
| Bit depth | 8-bit | 8, 10, and 12-bit |
| HDR & wide color gamut | No | Yes |
| Encode speed | Fast | Slow (several times slower) |
| Progressive rendering | No | No (decodes all-at-once) |
| Browser support | Universal 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.
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
WebP vs JPG: Which Should You Use?
WebP files are typically 25–34% smaller than JPEGs at the same quality — but JPG still wins in some situations. A practical comparison with a decision table.
Read the guidePNG vs JPG: When Each Format Wins
PNG is lossless and supports transparency; JPG makes photos dramatically smaller. Learn exactly which format to use for screenshots, photos, logos, and the web.
Read the guideHow to Reduce Image File Size for Email and the Web
Photos too big to email or slowing down your site? Learn the two levers that actually shrink images — resizing and compression — and the settings that keep them looking good.
Read the guide