AVIF vs JPEG XL: Which Image Format Should You Use in 2026?
In this article
AVIF and JPEG XL are the two image formats that beat JPEG and WebP on size, and in 2026 both finally display in the main browsers. They are not interchangeable. AVIF makes the smallest files at everyday web quality and works for about 97% of visitors. JPEG XL wins at high quality, encodes faster, can shrink an existing JPEG with no loss at all, and still cannot be shown by about a third of browsers. This guide puts the two side by side using the figures from our own tests, so you can pick the right one for the images on your site.
The short answer
- For product photos, hero images and screenshots, use AVIF. At the same visual quality as a JPEG saved at quality 80, our AVIF files were 37% to 67% smaller, and the format works in Chrome, Edge, Firefox and Safari.
- For high-fidelity photography, use JPEG XL first and AVIF second. At an excellent quality score, JPEG XL produced files 23% to 49% smaller than AVIF on our two photos and encoded faster.
- For an archive of existing JPEGs, use JPEG XL. It recompresses a JPEG losslessly, 11% to 17% smaller in our tests, and the original comes back byte for byte.
- Never serve JPEG XL on its own. Edge, Samsung Internet and Opera cannot show it, so always list it above an AVIF or JPEG fallback in a picture element.
File size at the same visual quality
Comparing formats at the same quality number is misleading, because "quality 80" means something different in every encoder. We scored every file with SSIMULACRA2, a perceptual metric that rates how close a compressed image looks to the original, and found the smallest file in each format that matched a standard JPEG at quality 80. These are the results for three homepage screenshots from our portfolio, each 1280 by 800 pixels:
| Image | JPEG q80 | AVIF | JPEG XL |
|---|---|---|---|
| Pool and garden photo with a headline | 139 KB | 88 KB (-37%) | 96 KB (-31%) |
| Fence and houses photo with a headline | 151 KB | 90 KB (-41%) | 115 KB (-24%) |
| Flat interface with text and pricing cards | 99 KB | 33 KB (-67%) | 49 KB (-51%) |
AVIF was the smallest on all three at everyday web quality. Raise the bar to a score of 85, which the metric's authors describe as excellent, and the picture changes:
| Image | JPEG | AVIF | JPEG XL |
|---|---|---|---|
| Pool and garden photo | 580 KB (q99) | 395 KB (-32%) | 203 KB (-65%) |
| Fence and houses photo | 340 KB (q96) | 236 KB (-31%) | 182 KB (-46%) |
| Flat interface | 173 KB (q95) | 50 KB (-71%) | 71 KB (-59%) |
At high quality JPEG XL produced the smallest file on both photos, while AVIF needed near-maximum settings to get there. On the flat interface AVIF stayed ahead. The full method, the encoder versions and the WebP results are in our WebP vs AVIF vs JPEG XL comparison, and you can run the same comparison on one of your own photos with our free image format tester.
Browser support in November 2026
This is where the two formats part company. According to caniuse data updated on 5 November 2026, AVIF displays for about 96.7% of web users: Chrome since version 85, Edge since 121, Firefox since 93 and Safari fully since 16.4. JPEG XL displays fully for 54.0% and partially for a further 15.3%. Chrome 155 and Firefox 158 switched it on by default in October 2026, Safari has shown it since Safari 17 without progressive loading or animation, and Edge, Samsung Internet and Opera still leave it off.
So about 69% of visitors can see a JPEG XL image and about 31% cannot. That is why JPEG XL is an extra source in a picture element, not a replacement for anything yet.
Encode and decode speed
Per 1280 by 800 image on one CPU thread, at the settings that matched a quality 80 JPEG, AVIF took 237 to 293 ms to encode and JPEG XL 190 to 230 ms, against 6 to 9 ms for JPEG. AVIF slowed further at high quality, reaching 530 ms at quality 98. Decoding was quick for both: 4 to 8 ms for AVIF and 12 to 20 ms for JPEG XL.
For a single upload none of that matters. If you generate several sizes of thousands of product images, run the conversion in a background queue rather than on upload, whichever format you choose.
Lossless JPEG recompression: JPEG XL's unique trick
JPEG XL can take an existing JPEG and store it in a smaller file with no loss whatsoever, and the original JPEG can be recovered byte for byte. On our three JPEGs this saved 11%, 11% and 17%, less than the 20% often quoted, probably because our files were already optimised. AVIF has no equivalent: converting a JPEG to AVIF always re-encodes the pixels. For a photo library you want to keep intact, that makes JPEG XL the safer archive format.
Transparency
Both formats support an alpha channel. We tested our own logo, a 314 by 240 pixel PNG in which 74% of the pixels are transparent. JPEG XL lossless kept the transparency exactly at 5.9 KB, down from 13.2 KB as PNG. AVIF at quality 60 was smaller still at 2.9 KB, but it softened the transparent edges slightly. For a flat logo, lossless JPEG XL is the pixel-perfect choice; if you have the artwork as a vector, SVG beats both.
Converting between the two
There is no lossless route from JPEG XL to AVIF. You decode the JPEG XL file to pixels and encode those pixels as AVIF, which adds a second round of compression, so always convert from the highest-quality source you have. With the command-line tools from libjxl and libavif:
djxl photo.jxl photo.png
avifenc -q 60 -s 6 photo.png photo.avif
Going the other way, cjxl photo.jpg photo.jxl is the lossless recompression described above, and djxl photo.jxl photo.jpg gives the original back.
How to serve both
Let the browser choose. It uses the first source it supports and falls back to the plain image:
<picture>
<source srcset="hero.jxl" type="image/jxl">
<source srcset="hero.avif" type="image/avif">
<img src="hero.jpg" alt="Describe what the image shows" width="1280" height="800">
</picture>
Put JPEG XL first only on a photography-heavy site that has the pipeline for it; for most sites AVIF with a JPEG fallback is enough. Always set the width and height so the layout does not jump, and use lazy loading below the fold but never on the hero image, as our guide to lazy loading images explains. Image weight is the most common reason a page misses its Core Web Vitals targets, and fixing it is part of the technical SEO and site-speed work we do for the sites we build.
Questions people ask
Is JPEG XL better than AVIF?
At high quality, yes: on our two photos JPEG XL produced files 23% to 49% smaller than AVIF at an excellent quality score, and it encoded faster. At everyday web quality AVIF was smaller on every image we tested, and it works for about 97% of visitors against about 69% for JPEG XL. Better depends on what you are optimising for: AVIF for the web today, JPEG XL for fidelity and for archives.
Does every browser support AVIF?
Nearly. Chrome, Edge, Firefox and Safari all display AVIF, which caniuse puts at about 96.7% of web users as of November 2026. Keep a JPEG fallback in the picture element for the rest, and for email clients and older software, which do not read either new format.
Should I convert my existing JPEGs to AVIF or JPEG XL?
For the copies you serve on the web, AVIF, encoded from the highest-quality original you have. For the originals themselves, JPEG XL: its lossless recompression saved 11% to 17% on our files with the originals recoverable byte for byte, which AVIF cannot do.
Can I use JPEG XL on my website today?
Yes, as an extra source above AVIF in a picture element, where the browsers that support it will use it and the rest fall through. Not as the only format: Edge, Samsung Internet and Opera cannot show it, and Safari shows it without progressive loading or animation.
Where to start
Encode your three or four heaviest images as AVIF at around quality 60 to 65, serve them through a picture element with the JPEG as the fallback, and measure the page again. If the site is photography-led, add JPEG XL above the AVIF line and keep the lossless JPEG XL copies as your archive. If you would rather someone did it for you, book a free call and we will look at the site with you.