Ronalds Vilciņš

WebP vs AVIF vs JPEG for Websites in 2026

AVIF can produce impressively small files. WebP is a dependable modern default. JPEG remains useful for photographs and compatibility. The format name alone still does not tell you which export looks best at the smallest acceptable size.

The practical answer is to test representative images rather than convert the entire library on principle.

The three formats make different trade-offs

JPEG has universal support, fast encoding, and a mature toolchain. It lacks transparency and often needs more bytes than newer formats at comparable photographic quality.

WebP supports lossy and lossless compression, transparency, and broad browser support. It is often the easiest step down from JPEG without complicating the pipeline.

AVIF can compress photographs especially well and supports transparency and modern colour features. Encoding may be slower, and aggressive settings can remove texture or create artefacts even when the file size looks excellent.

MDN’s image file type guide is a useful reference for capabilities and support.

Compare quality at the size you will ship

A 90 KB AVIF is not automatically better than a 120 KB WebP. Look at faces, gradients, fine texture, text inside screenshots, and the actual rendered dimensions. A smaller damaged image is still damaged.

I would test AVIF on large photographic assets where the savings can matter. WebP is a good middle ground for a normal content site. JPEG remains a reasonable fallback and may still win for a particular source and encoder.

When a fallback is required, <picture> makes the order explicit:

<picture>
  <source type="image/avif" srcset="photo.avif">
  <source type="image/webp" srcset="photo.webp">
  <img
    src="photo.jpg"
    width="1600"
    height="1067"
    alt="Street photograph"
  >
</picture>

Do not generate three formats and six sizes for every tiny icon just because the build system can. More variants mean more storage, build time, and cache entries.

Screenshots, flat graphics, and transparent illustrations may suit lossless WebP, AVIF, PNG, or SVG differently from photographs. Format choice comes after the content type.

For a normal site, I would start with well-sized WebP images, test AVIF for the large photos, and keep JPEG where compatibility or the actual export makes it sensible. Good dimensions and sensible quality usually matter more than winning the format-fashion contest.

Enjoyed reading this?

If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.

← Back to all articles