If you build websites or manage one, you have probably heard the advice a dozen times by now: serve next-gen images. In 2020, that meant WebP. In 2026, AVIF is the format showing up in every performance audit, every Lighthouse suggestion, every blog post about page speed. But switching formats is not free. You need to know whether the gains are real, whether browsers actually support it, and whether it is worth rebuilding your image pipeline.

This is the practical comparison. No lab-only demos, no cherry-picked screenshots. Just the data, the trade-offs, and a clear answer about which format to use where.

MacBook Pro displaying code on a desk, representing web development and image format optimization
Photo by Hitesh Choudhary on Pexels

The state of image formats in 2026

Three years ago, JPEG dominated the web at around 40% of all served images. Today it has dropped to 32.4%, according to the HTTP Archive Web Almanac 2024. WebP climbed to 12%. And AVIF, which barely registered at 0.25% in 2022, now accounts for 1% of web images after growing 386% in two years.

Those numbers are still lopsided. WebP has twelve times the market share. But the growth curve tells you where things are headed. Major CDNs like Cloudflare, Fastly, and Vercel now auto-negotiate AVIF. WordPress added native AVIF upload support. Shopify and Squarespace serve it automatically. The ecosystem caught up while most people were still debating.

Why this matters to you right now: Images still make up roughly 38% of total page weight on mobile. The median largest image on a page is 135 KB, and at the 90th percentile it hits around 1 MB. Choosing the right format is one of the biggest single wins for page speed.

What is AVIF?

AVIF (AV1 Image File Format) is the still-image format derived from AV1 video compression, developed by the Alliance for Open Media. Its key advantage is aggressive compression: it typically produces files 30 to 50% smaller than JPEG at the same visual quality, and around 20% smaller than WebP for photographic content.

It supports:

  • Lossy and lossless compression
  • HDR and wide color gamut (10-bit and 12-bit depth)
  • Alpha transparency
  • Animated sequences
  • Film grain synthesis (preserves texture without storing noise)

The trade-off is encoding speed. AVIF is significantly slower to encode than WebP or JPEG, which matters for real-time image processing pipelines or on-the-fly resizing. At rest, on a CDN, it does not matter at all.

What is WebP?

WebP is Google's format, introduced in 2010 and now supported by every modern browser since 2020. It replaced the need for separate JPEG, PNG, and GIF files with one format that handles lossy photos, lossless graphics, and basic animation.

Compared to JPEG, WebP files are typically 25 to 35% smaller. It encodes fast, decodes fast, and has essentially universal support. If "next-gen images" is a checkbox on your to-do list and you just want it done, WebP works everywhere without surprises.

Its limitation is that it is older compression technology. VP8 (lossy WebP) was state-of-the-art in 2010. AV1 is fifteen years newer. The gap shows at low bitrates, where AVIF preserves detail that WebP smears.

Head-to-head: AVIF vs WebP

Here is how they compare across the metrics that actually decide which format to deploy:

File size

The HTTP Archive median bits-per-pixel tells the story cleanly. This is the real-world average across millions of images on the web, not a controlled test:

Bits per pixel (lower is smaller)PNG3.8 bppJPEG2 bppAVIF1.4 bppWebP1.3 bpp
HTTP Archive Web Almanac 2024. Note: WebP edges out AVIF in aggregate because many AVIF images on the web use high-quality settings for photography.

In controlled tests at the same visual quality (SSIM or VMAF matched), AVIF consistently wins by 20 to 30% over WebP. The aggregate data above looks close because early AVIF adopters tend to be photography-heavy sites that encode at higher quality settings. On an apples-to-apples basis, AVIF compresses more.

Visual quality at low bitrates

This is where AVIF pulls away. When you push compression hard, trying to get a hero image under 50 KB for example, WebP starts showing blockiness and color banding. AVIF degrades more gracefully, preserving edges and color transitions. If you are targeting aggressive compression for mobile or slow connections, AVIF gives you more room before things look bad.

Encoding speed

WebP encodes roughly 5 to 10 times faster than AVIF. A batch of 100 product photos that takes 8 seconds in WebP might take a minute or more in AVIF at comparable quality settings. This matters if you process images on upload in real time. It does not matter if you encode once and serve from a CDN, which is most production setups.

Decoding speed

Both decode fast enough that users never notice. WebP is slightly faster to decode on older mobile hardware, but the difference is single-digit milliseconds on modern devices. Not a deciding factor.

Speed test results on a smartphone illustrating web performance metrics
Photo by Thiago Japyassu on Pexels

Browser support

This was the blocker for AVIF until recently. Not anymore:

  • AVIF: 94.3% global browser support. Chrome 85+ (2020), Firefox 93+ (2021), Safari 16.4+ (2023), Edge 121+ (2024). The only gap is older Safari on pre-2023 iPhones that have not updated.
  • WebP: 97%+ global support. Every browser since 2020, including Safari 14+.

The gap is under three percentage points and shrinking every month as older iOS devices age out. For the vast majority of sites, AVIF support is no longer a blocking concern, provided you serve a fallback.

Feature support

FeatureAVIFWebP
Lossy compressionYesYes
Lossless compressionYesYes
Alpha (transparency)YesYes
AnimationYesYes
HDR / wide gamutYes (10/12-bit)No (8-bit only)
Film grain synthesisYesNo
Progressive decodingNoNo
Max dimensions65536 x 6553616383 x 16383

If you work with HDR content, product photography with subtle gradients, or high-resolution images over 16383px, AVIF is the only option of the two.

What about JPEG XL?

You might have heard about JPEG XL as the "true successor" to JPEG. It is technically excellent, with lossless JPEG recompression and progressive decoding that neither AVIF nor WebP offer. But here is the practical reality in 2026:

  • Browser support: 15.34% globally. Safari has partial support. Chrome removed it, then partially re-enabled it behind a flag.
  • No major CDN auto-negotiates it.
  • No major CMS supports it natively.

JPEG XL may win eventually, but you cannot ship it today as a primary format. It is a wait-and-watch situation. For now, the real decision is AVIF vs WebP.

When to use AVIF

Use AVIF as your primary format when:

  • You pre-encode images and serve them from a CDN or static build. The slow encoding does not affect users.
  • You want maximum compression. Every kilobyte matters for your LCP score, or you serve users on slow mobile connections in emerging markets.
  • You serve photographic content. Product images, editorial photography, hero images. This is where the quality-per-byte advantage is most visible.
  • You need HDR or wide gamut. For displays that support it, AVIF delivers colors that WebP literally cannot encode.
  • Your audience is on modern browsers. If your analytics show less than 5% Safari 15 or older, the fallback path barely fires.

When to stick with WebP

WebP remains the better choice when:

  • You encode on the fly. User-uploaded images resized at request time, real-time thumbnail generation, dynamic image APIs. The 5-10x speed difference matters here.
  • You need that last 3% of browser coverage and do not want to maintain a fallback stack at all.
  • Your images are mostly icons, UI elements, or simple graphics. The file-size difference between AVIF and WebP for flat-color illustrations is negligible.
  • You already deployed WebP and the gains from switching to AVIF are marginal for your content type. A 20% further reduction on a 30 KB icon is 6 KB. Not nothing, but maybe not worth the pipeline change.

The practical recommendation: use both

The real answer is not "pick one." It is serve AVIF first, WebP as fallback, with JPEG as the safety net. The HTML <picture> element makes this trivial:

<picture>
  <source srcset="photo.avif" type="image/avif">
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="Description" width="800" height="600">
</picture>

The browser picks the first format it supports. No JavaScript, no user-agent sniffing, no server-side logic. The 94% on AVIF-capable browsers get the smallest file. The remaining few percent get WebP or JPEG. Everyone gets a working image.

Developer working at a laptop with camera equipment nearby, representing image processing workflow
Photo by Vlad Bagacian on Pexels

How to implement this today

If you do not want to hand-code <picture> elements, most of the ecosystem handles it for you:

CDN-level auto-negotiation

  • Cloudflare: Enable "Polish" with WebP/AVIF in the Speed settings. It content-negotiates based on the Accept header.
  • Vercel / Next.js: The built-in Image component auto-serves AVIF with WebP fallback. Zero config.
  • Fastly / Imgix: Append ?auto=format to your image URLs. The CDN detects browser support and picks the best format.

CMS and platform support

  • WordPress: Native AVIF upload since WordPress 6.5. Plugins like ShortPixel or Imagify handle encoding and serve the right format via rewrite rules.
  • Shopify: Automatically serves AVIF or WebP through their CDN. You upload the original; they handle the rest.
  • Squarespace / Wix: Both auto-convert and serve modern formats. No action needed on your part.

Manual encoding

If you manage your own pipeline:

  • Sharp (Node.js): sharp(input).avif({ quality: 65 }).toFile(output)
  • libavif / cavif: CLI encoder. cavif --quality 65 -o photo.avif photo.png
  • Squoosh: Google's web-based encoder for one-off conversions.
  • Our converter: Drop your image in the AVIF converter or the WebP converter and download both in seconds, entirely in your browser.

Impact on Core Web Vitals

Google's Largest Contentful Paint (LCP) metric is directly affected by your hero image's file size. The LCP element on most pages is an image, and how fast that image downloads determines whether you pass the 2.5-second threshold.

Typical hero image optimizationJPEG ORIGINAL850 KBAVIF OPTIMIZED195 KB
A realistic before/after for a 1200px hero image at visually equivalent quality.

That kind of reduction, around 77%, directly translates to faster LCP, better Core Web Vitals scores, and a measurable SEO advantage. Google has stated that page experience signals, including CWV, influence ranking. On competitive queries, the site with faster images wins the tiebreaker.

AVIF and AI-generated images

One more angle worth mentioning: AI image generators like Midjourney, DALL-E, and Stable Diffusion output large PNG or JPEG files, often 4K resolution at several megabytes each. If you are publishing AI-generated content (product mockups, editorial illustrations, social posts), AVIF compression is especially effective because these images tend to have smooth gradients and synthesized detail that AVIF's film grain tool handles exceptionally well.

A typical AI-generated 4K image at 8-12 MB as PNG compresses to under 300 KB as AVIF with no visible loss. That is not a typo. The savings on synthetic content are extreme.

Compatibility checklist before you switch

Before going all-in on AVIF, verify these do not apply to you:

  • Email campaigns: Most email clients do not support AVIF (or even WebP). Stick with JPEG/PNG for email.
  • Social media sharing: When platforms scrape your Open Graph image, they need JPEG or PNG. Keep your og:image in a universally supported format even if your page images are AVIF.
  • Print workflows: AVIF is web-only. If images get downloaded for print, offer a JPEG or TIFF alternative.
  • Legacy CMS or tools: If your image pipeline involves software that cannot read AVIF, you need the WebP or JPEG copy anyway.
Practical tip: Generate all three formats at build time. Serve AVIF and WebP to browsers via <picture>, but keep the JPEG as your canonical source for social sharing, email, and anywhere a single URL must work universally.

The bottom line

In 2026, the format decision is straightforward:

  • For maximum performance: Serve AVIF first, WebP fallback, JPEG safety net. This is what Google recommends, what every major CDN supports, and what gives you the best Core Web Vitals scores.
  • For simplicity: WebP everywhere. It is nearly as small, encodes faster, and works in every browser without exception.
  • The wrong answer: Still serving only JPEG in 2026. You are leaving 40 to 70% file size savings on the table, and your competitors are not.

AVIF is no longer the future. It is the present. The browser support is there, the tooling is there, and the performance gains are too large to ignore. If you have not converted your images yet, the AVIF converter takes about ten seconds per file and runs entirely in your browser.