Skip to main content
PicKit

Web images

WebP, AVIF or JPEG: Which Format Should Website Images Use?

· 5 min read

Images are usually the heaviest part of a web page, so the format you pick affects how fast the page feels. JPEG is the safe old standard. WebP and AVIF are newer formats that usually make smaller files. The right choice is rarely one format: it is a small set of files the browser chooses from.

The short answer

  • Use WebP as your main format for photos and graphics. It is usually smaller than JPEG at a similar look and it works in all current major browsers.
  • Add AVIF when you want the smallest files and can accept slower encoding. Offer it first, with WebP and JPEG behind it.
  • Keep a JPEG (or PNG for transparency) as the fallback for older software, email clients and anything that has to open the file outside a browser.

How the three compare

  • JPEG: understood by everything, good for photographs, no transparency. Quality is a slider: lower quality, smaller file, more visible blocks.
  • WebP: lossy and lossless modes and transparency. Typically smaller than JPEG at a similar look. Supported by all current major browsers.
  • AVIF: often the smallest, with good detail at low sizes. Creating AVIF files is slower than JPEG or WebP, and some older programs cannot open them.

How much smaller depends on the picture. A noisy, detailed photo saves less than a smooth one, so measure on your own files instead of trusting a rule of thumb.

Serve all three with the picture element

You do not have to choose one format for every visitor. The picture element lists the files from most to least preferred and the browser takes the first one it understands. Put AVIF first, then WebP, and finish with the img element that points at the JPEG.

Pair it with several widths, so a phone downloads a small picture and a large screen a bigger one. The srcset and sizes attributes describe those widths to the browser. Writing the file names and the width numbers by hand is where mistakes creep in.

ToolWebsite Image Delivery KitCreates the AVIF, WebP and JPEG files at the widths you choose, packs them in a ZIP and writes the picture, srcset and sizes HTML that refers to exactly those file names and sizes, with an estimate of the saving.

A simple routine

  1. Start from the largest original you have, not from a picture that was already compressed.
  2. Decide the widths your layout really uses (for example 480, 768, 1200 and 1920 pixels).
  3. Generate AVIF, WebP and JPEG at those widths and look at the result at full size before you publish.
  4. Paste the generated HTML, upload the files and test the page in a real browser.

If you only need to change a few pictures from one format to another, the converter does that directly, and the image compressor lets you lower the quality of a JPEG or WebP and compare before you save.

ToolImage ConverterConverts between JPG, PNG, WebP, AVIF and more, one picture or a batch of 20, in your browser. You choose the output format; nothing is uploaded.