AVIF vs WebP vs JPEG compared
Compare AVIF, WebP, JPEG and PNG encoded from one identical frame. AVIF came out 43 percent smaller than JPEG and 45 percent smaller than WebP.
The AVIF-versus-WebP argument is usually conducted with numbers from someone else’s test set. Here is one frame, four formats, measured.
Short version. AVIF won decisively on size, by 43% against JPEG and 45% against WebP, and paid for it with 3.5x the encode time, which on a single image nobody will notice.
| Variant | Encode | Size | Cost |
|---|---|---|---|
| JPEG q3 | 126 ms | 39.2 KB | $0.0015 |
| JPEG q8 | 124 ms fastest | 23.4 KB | $0.0022 |
| WebP q80 | 168 ms | 24.6 KB | $0.0015 |
| AVIF crf30 | 428 ms | 13.4 KB | $0.0017 |
| PNG lossless | 197 ms | 264.3 KB | $0.0016 |
AVIF is not a marginal win
| Format | Size | vs AVIF |
|---|---|---|
| AVIF | 13.4 KB | — |
| JPEG q8 | 23.4 KB | +75% |
| WebP q80 | 24.6 KB | +84% |
| JPEG q3 | 39.2 KB | +193% |
| PNG | 264.3 KB | +1,872% |
Getting the same picture out in 13.4 KB instead of 23.4 KB is the kind of difference that shows up in a Core Web Vitals score, not just in a spreadsheet. On an image-heavy page it is most of your LCP budget.
The catch is not encode time. It is that AVIF decode support, while now broad, is still worse than JPEG’s, and JPEG’s is universal. The standard answer is a <picture> element with AVIF first and a JPEG fallback, which means encoding both and serving whichever the browser admits to supporting.
WebP’s reputation is better than its numbers
24.6 KB against JPEG’s 23.4 KB. At these settings WebP was marginally larger.
That is not the received wisdom, and it deserves a caveat: WebP quality 80 and JPEG q8 are different scales, so this is one point on two different curves rather than a matched-quality comparison. What it does show is that WebP’s advantage over a well-tuned JPEG is far smaller than the “30% smaller than JPEG” claim that follows it around, and that claim usually compares against a badly tuned JPEG.
If you already ship WebP, AVIF is the upgrade worth making. If you ship JPEG, going to WebP alone is not obviously worth the pipeline change.
PNG is not a delivery format
264.3 KB, nearly twenty times the AVIF, for a photographic frame.
PNG is lossless, so it stores every sensor artefact and every compression artefact already baked into the source. That is exactly right for screenshots, diagrams and anything with flat colour and hard edges, and exactly wrong for photography. It is on this list because people reach for it by default and then wonder why the page is slow.
The encode times are all irrelevant
124 ms for JPEG, 168 ms for WebP, 428 ms for AVIF, 197 ms for PNG.
AVIF is 3.5x the slowest of the lossy options and it is still under half a second for a single frame. Unless you are encoding at genuinely high volume, this column should not influence the decision at all. Pick on output size and decode support.
The one place it matters: AVIF encoding scales badly with resolution and with effort settings. At -cpu-used 8 we are on the fast end. Pushing quality further gets slow quickly, which is why AVIF is usually generated once at upload rather than on the fly.
About the quality settings
JPEG -q:v 3 and -q:v 8, WebP -quality 80, AVIF -crf 30. Each is that format’s own conventional setting and none of them mean the same thing.
Note also that JPEG’s scale runs the opposite way to everything else: -q:v 2 is best and 31 is worst, so q8 is lower quality than q3, which is why q8 is the smaller of the two JPEGs. That inversion catches people constantly.
A matched-quality comparison would need SSIM or butteraugli scoring on every output. That would move the size column and is a different piece of work. What is solid here is the ordering, which is large enough that calibration will not reverse it.
Where this stops
One frame, one 1280x720 photographic source, extracted at the two-second mark. Content is the biggest variable in image compression: flat graphics and text favour PNG and WebP’s lossless mode dramatically, and none of that is visible in a single photographic frame.
Image formats are one part of a wider codec comparison on the same source, collected in Video codec comparison, measured.
Frequently asked questions
Is AVIF smaller than WebP?
Substantially. On the same frame AVIF produced 13.4 KB against WebP's 24.6 KB at quality 80, which is 45% smaller. Against JPEG it was 43% smaller.
Is WebP much smaller than JPEG?
Not at comparable settings. WebP at quality 80 came out marginally larger than JPEG at q8 in our test. The widely repeated 30%-smaller claim is usually measured against a poorly tuned JPEG.
Why is JPEG q8 smaller than JPEG q3?
Because FFmpeg's -q:v scale for JPEG runs backwards to CRF: 2 is best quality and 31 is worst. So q8 is the lower-quality, smaller file.
Should I use PNG for photos?
No. PNG produced 264.3 KB against AVIF's 13.4 KB on the same frame. PNG is lossless and correct for screenshots and flat graphics, and badly wrong for photography.
