If you've ever worked on speeding up page loads, you know images eat up the lion's share of web traffic. For years we lived on classic JPEG and PNG, moved on to WebP, and now two next-gen heavyweights have stepped into the ring: AVIF and JPEG XL.
The web community has been locked in a heated debate: JPEG XL fans hail it as the universal format of the future, while AVIF supporters point to its jaw-dropping compression efficiency. To settle the score, well-known web engineer Jake Archibald (formerly of Google and Shopify) ran a massive independent benchmark, testing fresh encoders—avifenc 1.4.2, libjxl 0.12.0, and jixel 0.4.2—across hundreds of diverse images.
The results of this showdown turned out to be surprising and busted several stubborn myths.
Lossy Photo Compression: A Clean Sweep for AVIF
The main battleground on the web is everyday lossy photography—and here, AVIF pins its rival to the mat.
At default encoder settings, a JPEG XL file matching the same visual quality (measured by the objective SSIMULACRA2 metric) ends up 15–25% larger than AVIF. Crank the compression sliders all the way up and the gap narrows, yet JPEG XL still comes out 6–20% heavier. Only on rare shots with ultra-complex textures like stoat fur does JPEG XL reach parity, while across 90% of typical content photos, AVIF wins hands down.
Archibald also warns against using outdated 4:2:0 chroma subsampling: in AVIF, you should stick to 4:4:4. It barely adds to file size while preventing fine colored details from turning blurry.
Screenshots and Transparency: A Lopsided Score
For UI graphics, the gap turns into a chasm. A long-standing web myth claims that app screenshots and diagrams must be saved as lossless PNGs or text will turn fuzzy.
The benchmark showed that lossy AVIF with 4:4:4 subsampling handles screenshots remarkably well: tiny UI text stays crisp and readable without ugly halos around characters. JPEG XL, on the other hand, suffers a crushing defeat on screenshots—its files come out 30–90% larger than AVIF at default settings, and 20–70% larger at maximum effort.
Transparency is even rougher for JPEG XL. By default, AVIF compresses the alpha channel with gentle lossy compression to save bytes. JPEG XL's new jixel encoder compresses transparency strictly losslessly, causing transparent-background images to balloon to 2–3x the size of an equivalent AVIF.
Where JPEG XL Strikes Back
Does that mean you can write off JPEG XL completely? Not at all. It still holds three unique trump cards that AVIF can't beat:
- Lossless compression: when you need bit-for-bit preservation of the original (like in print production or medical imaging), JPEG XL is the undisputed king. Lossless WebP is 9–17% larger, and lossless AVIF falls behind by a massive 30–120%.
- Lossless JPEG recompression: JPEG XL can recompress existing JPEG files without losing a single pixel of information, shaving 9–20% off their size with no re-encoding or generation artifacts.
- Ultra-high resolutions: on massive photos above 18 megapixels, Chrome's decoder renders JPEG XL noticeably faster and with less RAM than AVIF.
What to Ship in Production Today
The practical takeaway from the benchmarks is refreshingly pragmatic.
If your goal is fastest page loads, saving mobile bandwidth for users, and strong Core Web Vitals, AVIF 4:4:4 should remain your default format in web production.
JPEG XL is fantastic for lossless archival storage, ultra-high-res galleries, and automatically shrinking legacy JPEG libraries. But for everyday web markup, AVIF delivers the biggest win for every byte sent over the wire.

