Reference guide · images · Published 2026-08-16 · 4 min read

Next-generation image format guide

Compare AVIF, WebP and JPEG XL for current browser support and compression, and pick the safest serving stack with correct fallbacks.

Flat editorial illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: this article at a glance.

The modern formats that replace JPEG and PNG for web images are AVIF, WebP and JPEG XL. Each wins on the same axis, compression per byte for equal quality, but the three differ sharply in how many real visitors can decode them today. The decision is less about which format compresses best and more about which one your current browsers can display, with a correct fallback for everyone else.

Editorial close-up illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: a closer look at the technique described above.

The candidates

FormatCodec baseCompression vs JPEGNotes
WebPVP8/VP9StrongSafe default, decoded by every current browser
AVIFAV1Strongest widely deployedSupported in Chrome, Edge, Firefox, Safari 16.4+ for stills
JPEG XLModular codecVery strongInspection and editing friendly, but support is thin

Current support, checked

Support is the deciding factor, so it deserves the current picture:

The practical ceiling of JPEG XL is too low for production delivery. It remains a strong choice for an image archive or an internal editing pipeline, not for public web delivery in the current stable browsers.

The decision matrix

Your needFirst choiceFallback
Photos and gradients at small sizeAVIFWebP, then JPEG
Maximum compatibility, simple rolloutWebPJPEG
Animated short loopsWebP or animated AVIFGIF
Flat logos and UIPNG or SVGWebP
Archive or source mastersJPEG XL or AVIFJPEG

Serve through picture so each visitor gets the best file their browser accepts:

<picture>
  <source srcset="photo.avif" type="image/avif">
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="A coastal path at sunset" width="1200" height="800">
</picture>

The img is the final fallback and holds alt plus dimensions, so a browser that supports no modern format still gets the JPEG.

Encoding cost and pipeline

AVIF encoding is slower than WebP, and AVIF for an entire media library can be an order of magnitude slower than WebP. Size the pipeline to reality: convert the small, high-value subset (heroes, previews) to AVIF and keep WebP for the long tail, or let an image CDN encode on demand. JPEG XL decoding is being rebuilt around a Rust decoder in Chrome; treat format benchmarking as an exercise, not a reason to ship the format today.

Decide for your site

  1. Check your visitors' browsers over the last 90 days. If your logs show AVIF and WebP are both decoded, ship AVIF first for photos.
  2. Keep the master original in a lossless format and never overwrite it with a web variant.
  3. Test real weight on a page, not marketing numbers, and compare median transfer across JPEG, WebP and AVIF.
  4. Ship a JPEG fallback for the smallest possible group of legacy clients, then retire it when your logs show none.

The image compression guide sets the size budget, and the AVIF vs WebP article goes deeper into the two leading choices if you only want to compare those.

When to involve a professional

If your media library is large enough that AVIF encoding slows your deploy cycle, an image pipeline (a builder or a CDN that resizes and converts on demand) is the right fix. That is a design task for a performance engineer or your host, not a weekend script, because the caching, purge and fallback ordering all have to hold together at scale.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services