TL;DR
Get the latest gadgets delivered free with Prime
- Fast, free delivery on millions of items
- Prime Video, Amazon Music and more included
- Member-only deals all year
A 2026 comparison of current image encoders finds AVIF generally produces smaller lossy files than JPEG XL for web photos, screenshots, illustrations and transparency, and is faster to decode. JPEG XL performs better in lossless compression, can shrink existing JPEGs without further loss, and sometimes beats AVIF on individual images; results depend on the image and encoder.
A new comparison of JPEG XL and AVIF for web images finds that AVIF generally produces smaller lossy files and decodes faster, while JPEG XL wins in lossless compression and can perform better on selected images. The report comes as its author says JPEG XL has reached all major browsers, giving web developers a broader practical choice of formats.
For lossy photographs, the report says the best-performing JPEG XL version typically generated files 15% to 25% larger than AVIF at default effort settings. At maximum effort, the usual gap narrowed to 6% to 20%. There were exceptions: on some images JPEG XL came close to or beat AVIF, so the author recommends testing both when file size for a particular asset matters.
AVIF had a wider advantage on screenshots and illustrations. In those tests, JPEG XL files were generally 30% to 90% larger at default effort and 20% to 70% larger at maximum effort. For images with transparency, libjxl files were 31% to 44% larger at default effort and 61% to 70% larger at maximum. The report says the alternative JPEG XL encoder jixel encodes transparency losslessly, resulting in files two to three times AVIF’s size.
Performance and encoder choice also affected the results. The report found AVIF generally faster to encode and decode than JPEG XL when accounting for output size; JPEG XL typically took two to three times as long to decode at medium quality. The author says jixel can encode faster and use less memory than AVIF, but often produces larger files. The tests used avifenc 1.4.2, libjxl 0.12.0, jixel 0.4.2 and cwebp 1.6.0, among other settings.
Choosing Formats for Web Images
The comparison gives developers evidence for format selection, but not a universal winner. Smaller image files can reduce the amount of data a page transfers, while decode time affects how quickly images become usable on a visitor’s device. The reported differences are large enough to matter for image-heavy sites, yet vary by content type, encoder and settings.
The author’s current recommendation is to use AVIF in 4:4:4 mode for general web images and choose a high effort setting that fits the production workflow. If an AVIF result seems unusually large, the report suggests testing JPEG XL with jixel on that asset. This is a practical recommendation based on the tested implementations, not a guarantee that AVIF will win every image or every future encoder comparison.
As an affiliate, we earn on qualifying purchases.
Browser Support and Test Scope
The report frames its comparison around current browser use and says JPEG XL has now landed in all major browsers. It also notes a difference in progressive display: Chrome and Firefox support progressive JPEG XL, while Safari displays the completed image rather than its progressive previews. AVIF progressive rendering is available in Chrome, with Firefox support described as in progress at the time of publication.
The findings reflect a defined set of encoders and test images, not every possible image or future codec release. The author describes a benchmarking script that encoded selected images at different settings and recorded file and performance details. Most images were resized to 1,598 pixels wide, matching twice the maximum display width used on the author’s blog. The report also cautions that JPEG XL results vary substantially by encoder: jixel usually made smaller files than libjxl, except in some cases involving detailed transparency.
Where Results May Differ
The report’s percentages describe its selected images and encoder versions; they should not be treated as fixed outcomes for every website. The comparison does not establish how the formats will perform with other image collections, production pipelines, device hardware or later encoder releases. Its author notes that both AVIF and JPEG XL implementations have improved recently, so the recommendation could change.
Some format capabilities also remain unevenly supported. The report says JPEG XL’s format supports gain maps, but browser decoders do not support them and the encoding process is experimental or complicated. For non-gain-mapped HDR images, two quality metrics used in the comparison disagreed substantially, even though both indicated smaller JPEG XL files than AVIF. These caveats limit how broadly that HDR result can be applied.
Testing Before Site-Wide Changes
The report does not announce a browser policy change or a new codec release. Its practical next step for developers is to test representative images from their own sites with current encoders, comparing visual quality, file size, encoding cost and decode behavior. Teams can begin with AVIF 4:4:4, then check JPEG XL where AVIF’s output is unexpectedly large or where lossless results are required.
Future comparisons may shift as browser support and encoder versions develop. For now, the report supports a case-by-case workflow: use the tested results as a starting point, record which encoder and settings produced each asset, and recheck when those implementations change.
Key Questions
Which format is generally smaller for lossy web images?
In the tested implementations, AVIF usually produced smaller files. For lossy photographs, the best JPEG XL encoder was typically 15% to 25% larger at default effort settings, with a narrower gap at maximum effort. Individual images can differ.
Does JPEG XL ever beat AVIF?
Yes. The report found outliers where JPEG XL came close to or beat AVIF on particular images. It recommends testing both formats for assets where the smallest acceptable file is a priority.
Which format is better for lossless images?
The report calls JPEG XL the clear winner in its lossless tests. Lossless WebP files were 9% to 17% larger for photos, and lossless AVIF files were 30% to 120% larger. The author cautions that lossless images are rarely needed for web delivery.
What settings does the report recommend for AVIF?
The author recommends AVIF 4:4:4 with a high effort setting. The report says 4:2:0 rarely reduced file size in its tests and could make higher quality harder to reach, though it encoded and decoded faster.
Should every website switch formats based on this comparison?
No. The findings apply to the tested images, encoders and settings. Developers should compare representative assets from their own sites because image content and implementation can change which format performs best.
Source: hn
Fall Picks
fall essentials
As an affiliate, we earn on qualifying purchases.
