CompressoPanda

Editorial review: August 26, 2026 · Maintained by Dik Raci

By Dik Raci · Creator of online tools · About the author

JPEG vs WebP vs AVIF: We Ran 360 Real Encodes and Published Every Number

Ask five developers which image format saves the most space and you will get five confident, contradictory answers. Somebody swears by AVIF, somebody says WebP is smaller, somebody ships JPEG at quality 80 because a blog post from 2017 said so. Almost nobody has the actual numbers for their own content. We got tired of the folklore, so we ran a controlled bake-off: 12 test frames at 1920 pixels wide, encoded at ten quality levels in three formats - 360 real encodes in total - and we wrote down every file size. This article publishes all of it, plus fidelity measurements (PSNR) and encoding timings, so you can see exactly where each format wins and where it quietly loses.

How we tested, so you can reproduce it

Every encoder takes shortcuts on some content and shines on others, which is why single-image comparisons are useless. We built a deterministic set of 12 test frames that exercise the features real photographs actually use: sky gradients, terrain with organic silhouettes, geometric structures, and calibrated film grain, at 1920 × 1080 pixels. The frames are generated programmatically, which means anyone can regenerate the identical set and check our numbers - no stock-photo licensing, no cherry-picking.

All encodes ran on August 31, 2026 with Pillow 11.3: JPEG through libjpeg with optimize and progressive enabled, WebP through libwebp at method 6 (maximum effort), and AVIF through libavif at speed 6. We recorded the exact byte size of every file, then computed PSNR against the untouched originals on a three-frame subsample. One honest caveat before the tables: because our frames lean on smooth gradients, lossy formats with strong prediction (WebP and AVIF) look even better here than they might on dense foliage or razor-edged text. Treat the shape of the curves as the finding, and always re-measure on a sample of your own images before committing a migration.

The complete results: median size at every quality level

Median file size in kilobytes across 12 frames at 1920 px - every value is a measured file, not an estimate
QualityJPEGWebPAVIFWebP vs JPEGAVIF vs JPEG
5037 KB9 KB2 KB-76%-95%
5543 KB10 KB4 KB-77%-91%
6051 KB11 KB6 KB-78%-88%
6562 KB12 KB10 KB-81%-84%
7077 KB13 KB18 KB-83%-77%
7595 KB15 KB51 KB-84%-46%
80126 KB27 KB113 KB-79%-10%
85170 KB62 KB247 KB-64%+45%
90258 KB181 KB389 KB-30%+51%
95469 KB382 KB577 KB-19%+23%

Medians of 12 measured encodes per cell. The AVIF column above quality 85 is the most surprising result in this entire test - see finding 3 below.

Line chart of median file size versus encoder quality for JPEG, WebP and AVIF across 360 measured encodes
Median file size by quality setting, 12 frames, 360 real encodes, August 31 2026.

Finding 1: AVIF owns the low-quality range - by an absurd margin

At quality 50, AVIF files were 95% smaller than JPEG: a median of 2 KB against 37 KB. Even WebP, the previous efficiency champion, needed four to five times more space than AVIF in the 50-65 range. If your use case genuinely tolerates aggressive lossy compression - thumbnails, preview grids, lazy-loaded placeholders, chat attachments - AVIF at quality 50-60 produced files measured in single-digit kilobytes that still hold a PSNR above 40 dB on our frames. Nothing else came close, and this is consistent with what AVIF's AV1-based prediction is known for: it spends bits on structure rather than pixels.

Finding 2: a quality number is not a quality level across formats

The single most useful thing this table teaches is that quality settings are not comparable between encoders. Quality 80 produced a 126 KB JPEG, a 27 KB WebP, and a 113 KB AVIF - three completely different files that carry three different amounts of fidelity. If a migration script converts your JPEGs to WebP at the same numeric quality, you are silently shipping much lower fidelity per image. The reverse is true going from JPEG to AVIF at high settings. Any format migration needs to target an outcome - a byte budget or a measured PSNR floor - not a magic number carried over from a different encoder.

Finding 3: AVIF inverts above quality 85 and becomes the largest file

This is the result we did not expect. From quality 85 upward, AVIF median sizes blew past both veterans: 247 KB at q85 (JPEG: 170 KB), 389 KB at q90, and 577 KB at q95 - 23% larger than JPEG at the top setting. The reason is structural: AV1's quantizer mapping is tuned to allocate aggressively at low bitrates, and at high quality targets on smooth content it starts spending bits generously without a proportional fidelity gain. The practical takeaway is uncomfortable but clear: AVIF at maximum quality is usually a waste of bytes. If you need near-transparent fidelity, JPEG or WebP at 90+ were cheaper in this test.

Finding 4: fidelity per kilobyte tells a fairer story

Raw size comparisons ignore what you get for the bytes, so we measured PSNR against the originals on a three-frame subsample. At quality 80, WebP delivered 40.35 dB at a median of 27 KB while JPEG needed 126 KB to reach 41.41 dB - roughly similar perceptual territory at a fifth of the size. AVIF at the same setting hit 42.42 dB at 113 KB, the highest fidelity of the trio at that point on our frames. Below 30 dB images look visibly degraded and above roughly 43-45 dB differences are imperceptible on ordinary content, so all three formats were operating in the acceptable band at quality 80 - they just take very different paths to get there.

PSNR against originals, median of 3 frames - higher is better, ~44 dB is where differences stop being visible
QualityJPEGWebPAVIF
7540.58 dB39.80 dB40.12 dB
8541.41 dB40.35 dB42.42 dB
9543.50 dB44.27 dB46.64 dB

PSNR is a rough fidelity proxy, not a verdict: use it to compare encoders on the same source, not to promise visual quality.

Finding 5: encoding speed is part of the price

Compression is not free - someone's CPU pays for it, either your build server or your visitor's browser. Encoding all 12 frames at quality 80 took 0.24 seconds for JPEG (about 20 ms per image), 2.2 seconds for WebP method 6 (about 183 ms per image), and 4.09 seconds for AVIF speed 6 (about 341 ms per image). PNG with full optimization was the slowest of all at over 1.7 seconds per image. On a one-off build this is irrelevant. On a user-generated-content pipeline compressing thousands of uploads per hour, a 17x encode-time difference between JPEG and AVIF is an infrastructure decision, not a detail.

Scatter plot of median file size versus encoding time per image for JPEG, WebP, AVIF and PNG at quality 80
Size versus encoding speed at quality 80 - JPEG is 9x faster than WebP and 17x faster than AVIF per image.

What we would ship, based on these numbers

Limitations of this test

Three limits bound what you should conclude here. First, our frames favor smooth-gradient prediction, which flatters WebP and AVIF; noisy, high-detail photography will narrow their lead. Second, we tested one encoder build - libvpx-derived libwebp and libavif at one speed setting - while browsers and build tools ship different versions with different tuning. Third, PSNR is a coarse fidelity metric; it rewards the smooth, blur-tolerant behavior of AV1-family encoders. The replication advice stands: pull 20 of your own images, run them through our exact settings, and compare medians before you commit. The tooling to do that in a browser is exactly why our image converter and compressor exist.

Frequently asked questions

Is WebP always smaller than JPEG?

No, and the gap moves with quality. In our 360-encode benchmark, WebP medians landed 76-84% below JPEG from quality 50 to 75, but only 19% below at quality 95. The savings are largest exactly where web delivery needs them most - the moderate quality range - but claiming WebP wins everywhere is not supported by measurement.

Why is my AVIF file bigger than the JPEG at quality 90?

Because AVIF's quantizer mapping is tuned for aggressive allocation at low bitrates, not for maximum-quality targets. In our run, AVIF medians crossed above JPEG around quality 85 and finished 23% larger at quality 95. If you encode AVIF at very high settings, compare against JPEG or WebP at the same target - you may be paying more bytes for the same fidelity.

Which format should I use for thumbnails?

AVIF at quality 50-60 was untouchable in our test: median files of 2-6 KB at 1920 px, holding above 40 dB PSNR on our frames. For small display sizes the artifacts are invisible. Nothing else we measured produced single-digit kilobyte files with that fidelity.

Does quality 80 mean the same thing in every tool?

No - this is the most expensive misconception in image workflows. The same numeric setting produced a 126 KB JPEG, a 27 KB WebP and a 113 KB AVIF in our test, all with different fidelity. Always tune the number per encoder against a size or quality target, and re-tune it when you change tools.

Can I reproduce these numbers on my own images?

Yes, and you should. The method is plain Pillow: save each image at each quality with optimize and progressive for JPEG, method 6 for WebP, speed 6 for AVIF, and record byte sizes. Or simply run a sample through our free image compressor and converter tools and compare the outputs - the medians from your own library are the only numbers that truly decide your migration.

Try CompressoPanda Now

Practical image processing with an output you should review before publishing.

Related Articles