By insidethebox · · 6 min read

JPEG XL, AVIF and WebP compared on one photo at the same quality, plus features, browser support and the setup we recommend for websites in 2026.

Every major browser now shows WebP, AVIF and, since October 2026, JPEG XL. So which one should your images use? We encoded the same photo in each format at the same visual quality, compared what each format can do, and set out the setup we use on client sites.

To try it on your own images, use our free JPEG XL converter. It runs in your browser, so nothing is uploaded.

The short answer

  • Photos at high quality: JPEG XL makes the smallest files, with AVIF close behind.
  • Lower quality, small thumbnails: AVIF often wins.
  • Lossless images, screenshots and graphics: JPEG XL beats both PNG and lossless WebP.
  • Existing JPEGs: JPEG XL can shrink them by about 15–20% with no loss at all, and turn them back into the exact original.
  • On a website: don't pick one. Serve JPEG XL first, then AVIF, then a JPEG fallback, and let each browser take the best format it supports.

File size at the same quality

We scaled one 2400×1350 product photo to 1600×900 and encoded it in each format until it reached the same visual quality: a SSIMULACRA 2 score of 80, which is high quality, where most people can't tell the copy from the original.

FormatSame quality (lossy)Every pixel kept (lossless)
WebP144 kB913 kB
JPEG140 kB—
AVIF104 kB—
PNG—1,585 kB
JPEG XL95 kB760 kB

At this quality JPEG XL was 32% smaller than JPEG, 34% smaller than WebP and 9% smaller than AVIF. Lossless, it was 52% smaller than PNG and 17% smaller than lossless WebP.

WebP being slightly larger than JPEG here is not a mistake. WebP's lossy mode always halves the colour resolution and was tuned for medium quality, so at high quality it loses its edge. Lower the target and the ranking changes: AVIF pulls ahead, and WebP catches up with JPEG.

One photo is not a benchmark. Your results will depend on the picture and on the quality you aim for, so test a few of your own images.

Features compared

FeatureWebPAVIFJPEG XL
Lossy and losslessYesLossless is weakYes
TransparencyYesYesYes
AnimationYesYesYes
HDR and wide colourNo (8-bit only)YesYes
Progressive loadingNoLimitedYes
Reversible JPEG recompressionNoNoYes
Largest image16,383 px per side65,536 px per frame (larger as a grid of tiles)About a billion px per side

Two JPEG XL features have no equal in the other formats. Progressive loading shows a rough version of the whole picture after only a small part of the file has arrived, then sharpens it. Lossless JPEG recompression repacks an existing JPEG into a smaller JPEG XL file that can be turned back into the identical JPEG, byte for byte. Our test JPEG went from 320 kB to 271 kB this way.

Browser support in 2026

BrowserWebPAVIFJPEG XL
ChromeSince 32 (2014)Since 85 (2020)Since 155 (Oct 2026)
EdgeSince 18 (2018)Since 121 (2024)Since 155 (Oct 2026)
FirefoxSince 65 (2019)Since 93 (2021)Since 158 (Oct 2026)
SafariSince 14 (2020)Since 16 (2022)Since 17 (Sep 2023)

WebP and AVIF work for practically every visitor today. JPEG XL support is new in Chrome, Edge and Firefox, so a share of visitors on older versions won't have it for a while. That is why it belongs first in a list of formats, not on its own.

When to use each format

  • JPEG XL for photos where quality matters (product images, portfolios, hero images), for lossless images, and for any library of existing JPEGs.
  • AVIF as the fallback right after JPEG XL, and on its own for small or heavily compressed images where it tends to be smallest.
  • WebP mostly as a legacy option. If you already serve AVIF, WebP rarely adds anything.
  • JPEG and PNG as the final fallback in <img>, which every browser and app can open.
  • SVG for logos, icons and illustrations made of shapes: no raster format competes with it there.

The setup we recommend

Use the <picture> element so each browser picks the best format it understands:

<picture>
  <source srcset="product.jxl" type="image/jxl">
  <source srcset="product.avif" type="image/avif">
  <img src="product.jpg" alt="Describe the product" width="1600" height="900" loading="lazy">
</picture>
  • Order matters: the browser takes the first <source> whose type it supports.
  • Keep width and height on the <img> so the layout doesn't shift while the image loads.
  • Lazy-load images below the fold, but never the main image at the top of the page, which affects Largest Contentful Paint.
  • Image CDNs can choose the format per request from the browser's Accept header, so you upload one original and the CDN does the rest.

How to convert your images

  • In the browser: our JPEG XL converter turns JPG, PNG and WebP into JPEG XL, and JPEG XL back into PNG, without uploading anything.
  • On the command line: cjxl photo.jpg photo.jxl (libjxl) for JPEG XL, which recompresses JPEGs losslessly by default; avifenc photo.png photo.avif (libavif) for AVIF; cwebp -q 80 photo.png -o photo.webp (libwebp) for WebP.
  • In a build pipeline: most image tools and frameworks can emit AVIF and WebP today; check whether yours has added JPEG XL output since October 2026.

Common questions

Is JPEG XL better than AVIF? At high quality and for lossless images it usually makes smaller files, it loads progressively and it can recompress JPEGs without loss. AVIF is often smaller at low quality and has supported browsers for longer. Serve both.

Should I still use WebP? If you already serve AVIF, WebP adds little. Keep it only if you can't produce AVIF.

Will JPEG XL help my Google rankings? Not directly. Smaller images load faster, which helps Core Web Vitals (Largest Contentful Paint in particular), and page experience is one of Google's ranking signals.

Can people open .jxl files? Current versions of Chrome, Edge, Firefox and Safari show them, and so do recent macOS and iOS. Many older apps can't, so for files you send to people, a JPEG or PNG is still the safer choice.

Sources

Topics: Engineering · Product

All insights