AVIF vs JPEG XL vs JPEG: Which image format is best for you?
Last edited:
Arthur KhayrullinThis article aims toย clear the fog around newcomer image standards like AVIF and JPEG XLย versus the traditional format, JPEG, and guide you inย choosing the appropriate format for your use case.
What are AVIF, JPEGย XL, and JPEG?
What isย JPEG?
JPEG was developed inย 1992 toย provide efficient photo compression. Itย paved the way for lossy compression methods that take advantage ofย human vision imperfections. Itย has vast historic adoption among different mediaย โ from browsers and apps toย consumer printers. You can read aย number ofย articles about JPEG here onย the Uploadcare blog. For instance, check out our guideย on how toย optimize JPEG images.
What isย AVIF (AV1 Image File Format)?
AVIF isย aย fairly new format derived from the video codec AV1 that dates back toย 2019. AVIF aims atย delivering high-quality images, offering better compression than legacy image formats.
The format has been gaining traction and adoption. There are apps toย view AVIF images, asย well asย native support inย newer operating systems. But whatโs more important isย support onย the Webย โ all recent browser versions support AVIF, which makes itย aย good candidate toย replace JPEG.
What isย JPEG XL?
JPEG XL, JPEGโs successor, was standardized inย 2022. Initially, the format was onย par with AVIF, outperforming the latter inย different areas. Google removed it from Chromium in 2023, then began reintroducing it in Chrome 145 in early 2026, behind an experimental flag and powered by a new memory-safe Rust decoder (jxl-rs). For now, it stays off by default, so the format is still used mostly in offline settings and has a strong supporting community.
AVIF vsย JPEG: Isย AVIF always better?
AVIF vs. JPEG isย aย classic โoldย vs. newโ scenario, but with AVIF winning most ofย the time. Letโs diveย in.
Compression efficiency and file size
AVIF has aย better size-to-quality ratio. Under the hood, the algorithm splits anย image into blocks from 4ร4 toย 64ร64ย pixels, looks for colors and patterns, and tries toย predict the contents ofย nearby blocks.
Unlike JPEG, which works only with original data, AVIF saves the difference between predicted and actual values, providing aย better compression rate.
Hereโs the table comparing JPG and AVIF versions ofย 10ย images:
| No | Original image size | Uploadcare q=normal JPEG | Uploadcare q=normal AVIF |
|---|---|---|---|
| 1 | 993ย KB | 137ย KB | 107ย KB |
| 2 | 473ย KB | 46ย KB | 22ย KB |
| 3 | 1.01ย MB | 72ย KB | 37ย KB |
| 4 | 880ย KB | 108ย KB | 69ย KB |
| 5 | 1.03ย MB | 117ย KB | 77ย KB |
| 6 | 877ย KB | 91ย KB | 63ย KB |
| 7 | 674ย KB | 83ย KB | 54ย KB |
| 8 | 775ย KB | 80ย KB | 54ย KB |
| 9 | 859ย KB | 111ย KB | 70ย KB |
| 10 | 1.02ย MB | 110ย KB | 86ย KB |
Image quality and artifacts
Images compressed with AVIF contain fewer artifacts than JPEG. Take aย look atย this example ofย aย vector SVG file converted into both JPEG (onย the left) and AVIF (onย the right). The resolutions are the same.
JPEG vsย AVIF compared with DiffCheckerJPEG usually struggles with sharp edges and high contrast, and you can see that inย the screenshot. The AVIF onย the right looks much smoother. Here, the JPEG file isย 15.5ย KB, and AVIF isย 5.5ย KB.
Transparency and alpha channel support
Unlike JPEG, AVIF supports transparency, which makes itย suitable for graphics and logos.
Browser and software support
As of 2026, AVIF is supported by all major browsers in their recent versions, covering about 93% of users globally. Windows supports AVIF withย a free extension installed from the Microsoft Store, and macOS 13ย and upย offers native AVIF support. For mobile devices, native AVIF support starts from iOS 16ย and Androidย 12. Also, itย isย always anย option toย open anย AVIF file inย aย browser.
When toย choose AVIF over JPEG
The AVIF vsย JPEG debate isย often discussed when talking about websites.
Usually, most website visitors use modern browsers, soย itย isย safe toย switch toย AVIF.
You should still check your website analytics for aย visitor browser breakdown toย beย sure.
Also, keep inย mind toย introduce fallbacks using <picture> HTMLย elements.
Use JPEG for emails and legacy web-based systems.
Thereโs aย caveat, thoughย โ the filesize reduction numbers you may see online are usually averaged out. Soย before going allย in, test image conversion with apps like ImageOptim and Squooshย โ this helps you make anย educated decision based onย your particular setting.
Inย situations where using AVIF doesnโt make aย major difference, consider using Progressive JPEGย โ the image appears asย aย whole inย low-res and gets more details asย itย loads.
AVIF vsย JPEG XL: Aย technical showdown
AVIF and JPEG XLย are the two main candidates toย replace JPEG inย non-browser use cases.
Compression and file size
For the same perceptual visual compression level, JPEG XLย may outperform AVIF byย upย toย 25%. This isย especially true for photographic images compressed for high quality.
AVIF compared toย JPEG XLย with the same similarity index. Source: jpegxl.infoWhen compressing for aย low-quality target, AVIF surges aheadย โ itย tends toย make images blurry near the edges, obscuring compression artifacts. The screenshot below compares two formats inย aย low-quality settingย โ the clouds and stars look better inย the AVIF image despite having aย lower SSIMU2ย score. AVIF isย likely the best candidate for heavily compressed logos and diagrams.
AVIF compared toย JPEG XLย compressed for the smallest size. Source: jpegxl.infoPerceptual quality metrics such asย SSIMU2 are not โone-size-fits-allโ. For niche-specific applications, you may want toย analyze compression results based onย your own dataset ofย images.
Lossless vsย lossy compression options
Both formats support lossless compression, with JPEG XLย running aย bit ahead due toย its heritageย โ JXL supports lossless-transcoding for JPEG without re-encoding. Inย other words, itย โwrapsโ aย regular JPG file, compressing itย inย aย more modern way byย 16-22%. Basedย on this experiment, JPEG XLย outperforms AVIF byย aย significant amount.
For lossy compression, refer toย the screenshots above.
Color depth, HDR, and bit depth
JPEG XLย supports 32ย bits per channel versus AVIFโs 12ย bits, making the former aย better choice for industries that heavily rely onย smooth color gradients. For comparison, aย standard JPEG offers 8ย bits per channel. Both encoding formats support HDR and wide gamut.
Encoding and decoding Speed
Based onย the comparisons performed byย Google, AVIF outperforms JPEG XL when it comes to decoding speed in Chrome with JPEG XL enabled. Asย for encoding speed, one experiment found the JPEG XLย encoding process may beย upย toย 3ย times faster than AVIF, with visually matching quality settings.
Inย regards toย rendering JPEG XLย supports progressive loading: image appears asย aย whole getting more details asย itย loads. AVIF doesnโt support progressive loading.
Browser and platform support in 2026
Asย mentioned, AVIF isย aย clear winner hereย โ supported byย all mainstream browsers. In 2026, JPEG XL still is not a viable default for the Web. Chrome 145 re-added it behind an experimental flag in early 2026, but it stays off by default in Chrome and Firefox. Its global support on caniuse sits at about 14%, driven mainly by Safari 17 and later.
Real-world performance tests
Although extensive real-world testing goes beyond the scope ofย this article, thereโs stillย a useful takeaway: AVIF compression isย more efficient for low and medium-quality images, while JPEG XLย compression performs better for high-quality and lossless.
Use cases: Which format isย best for what?
Inย aย nutshell, AVIF isย the go-to recommendation for everything web-related, while JPEG XLย would shine inย anย industrial and color-centric setting.
Web performance and Core Web Vitals
Core Web Vitals (LCP, CLS, INP) are the quantifiable metrics byย Google that reflect the quality ofย aย siteโs UX. Improving these metrics inย aย meaningful manner increases the chances that aย visitor would engage with aย site for longer.
PageSpeed Insights report for image deliveryByย effectively utilizing AVIF toย replace heavy pictures onย aย website, you can conserve bandwidth and make all the necessary elements ofย aย page load faster, improving the Largest Contentful Paint and Interaction toย Next Paint metrics.
E-commerce and product photography
Images make upย aย vast portion ofย e-commerce store pages, soย using AVIFs instead ofย JPGs improves loading time, but itโs worth verifying onย aย case byย case basis.
Also, utilizing HDR preserves the fine details ofย product photos better and without JPG-like artifacts, which isย especially true for fabrics and textures.
You can expect even more savings when using AVIF images inย the 360-degree product view feature.
Digital art and transparency
Due toย good compression rates without color banding and with transparency support and animation capabilities, both AVIF and JPEG XLย are good candidates for handling digital art and design. Also, HDR support comes inย handy for preserving vibrant colors.
Additionally:
-
JPEG XLย can store splines and dots that are not โbakedโ into the original image, but stored asย aย separate layer. These doย not undergo JPEG DCT transforms and donโt get distorted when compressing.
-
Both formats can store noise separately. With regular JPEG, noise (even artistic) isย hard toย compress. JPEG XLย can preserve photon-like noise similar toย digital cameras, and AVIF adds film-grain-like noiseย โ inherently aย feature ofย the AV1 codec that drives AVIF.
Ifย the still-image art project you work with isย meant for both web and offline, use AVIF for webpage embedding and JXLย as downloadables.
For short looping videos orย cinemagraphs, AVIF performs betterย โ inย aย nutshell, itย isย aย video codec with features like motion estimation repurposed for images.
Archival and lossless requirements
Archival requires lossless compression, since archived files often serve the purpose ofย master copies. Choosing between JPEG XLย and AVIF, JPEG XLย would beย aย better option here due toย its superior lossless capabilities.
Ifย the initial images are inย JPEG, transcoding them with JPEG XLย would provide ~20% size reduction without re-encoding the image data itself.
JPEG XLย lossless transcoding. Source: jpegxl.infoPrint media and photography
Printing requires CMYK support, high bit depth, and precisionย โ JXL supports 32-bit depth and CMYK. AVIF doesnโt offer CMYK support, which makes itย incompatible with the professional printing industry. JPEG XLย also supports layers and upย toย 4099 channels for storing info like selection masks and spot colors.
How toย convert JPEG toย AVIF orย JPEG XL
While saving aย file directly toย AVIF orย JPEG XLย is the best option, sometimes the good old JPEG isย the only thing weย have. Hereโs how toย convert aย JPEG image into the new formats:
Online converters and tools
Online apps like CloudConvert and Squoosh can help you convert your existing images toย both AVIF and JPEG XL. Sqoosh even offers aย basic editor available after image upload soย you can tweak compression parameters, rotate the image, and preview the result.
You can also leverage Uploadcareโs Image CDN toย serve AVIF files across devices and platforms.
Using
AVIF conversion can beย done inย FFmpegย โ one ofย the most popular CLI tools for video conversion. Conversion toย AVIF using FFmpeg requires the aom library toย beย installed and included inย the FFmpeg build. Parameters may vary, but hereโs the gist ofย how toย perform aย basic conversion toย AVIF:
ffmpeg -i image.png -c:v libaom-av1 -still-picture 1 image.avifFFmpeg can also convert toย JPEGย XL, given that libjxl isย pre-installed asย well:
ffmpeg -i image.png -c:v libjxl image.jxlPlugin and CMS integration
Inย version 6.5, WordPress introduced native AVIF support. You can configure WordPressย to automatically convert uploaded JPG images into AVIF.
Shopify also introduced AVIF support. The system automatically detects the userโs device capabilities and delivers AVIF images when needed.
AVIF vsย JPEG XLย vs JPEG: Which one should you use?
| Parameter | JPEG | AVIF | JPEG XL |
|---|---|---|---|
| Lossless support | No | Yes | Yes |
| Transparency | No | Yes | Yes |
| Color depth | 8-bit | 12-bit | 32-bit |
| HDR/Gamut | No/sRGB | Yes/Rec.2020 | Yes/Rec.2020 |
| Animation | No | Yes | Yes |
| Browser support | 100% | 93%, all mainstream browsers | ~14%, not web-ready by default |
| Best for | Legacy | Web/E-commerce | Archival and professional usage |
Our recommendation byย use case
-
Web/Mobile: AVIF isย aย priority, use JPEG asย aย fallback
-
E-Commerce: AVIF for product pages, JXLย as โdigital negativesโ onย the back-end
-
Archival/Photography: JPEG XLย for lossless storage
-
Printing: JPEG XLย for preserving color depth, AVIF for previews.
FAQs
Isย AVIF better than JPEG?
Yes, AVIF isย better than JPEG because ofย compression rates, quality, and features (like transparency and HDR).
Isย JPEG XLย better than AVIF?
Yes, use JPEG XLย inย aย professional setting, for archival images, and printing. Use AVIF onย the Web.
What isย the best image format for websites?
AVIF is considered to be the best format for websites in 2026. Use the <picture> HTML tag to create JPEG fallbacks.
Can browsers display JPEG XL?
JPEG XL still is not recommended for general web use as of 2026. Chrome 145 re-added JPEG XL behind an experimental flag in early 2026 using a memory-safe Rust decoder, but it is off by default, and Firefox also keeps it behind a flag. Only Safari 17 and later support it natively, so global support is about 14%.
Isย AVIF supported byย WordPress?
Yes, starting from version 6.5. Ifย you donโt want toย update, consider using plugins from the WordPress plugin repository.