LighterpixCompress an image

In-browser image optimizer

AVIF vs JPEG

AVIF exists to replace JPEG, and on photographs it usually halves the file — sometimes more. The catch is that it is younger: encoding is slow, decoding costs more on old phones, and a JPEG opens on literally everything. That is a deployment decision, not a codec one.

Choose an imageTry a sample

Compare both on your own image

  1. Open your photoAny JPEG works; it decodes locally in the tab.
  2. Put AVIF on one side, keep JPEG on the otherStart AVIF at quality 55 and MozJPEG at 82. Compare the previews at 100% before comparing the numbers.
  3. Decide with a fallback in mindIf AVIF wins on your image, serve it through <picture> with the JPEG as the fallback. If the sizes are close, stay with JPEG and skip the complexity.

The numbers, without the marketing

At matched visual quality, AVIF is typically 50–70% smaller than JPEG for photographs, and the gap widens at low bitrates where JPEG starts to block badly. For screenshots and flat graphics both are the wrong tool: a lossless PNG or WebP will look better and often be smaller than either.

What you pay for those bytes

Encoding an AVIF takes seconds rather than milliseconds, which matters if you generate images in a build pipeline. Decoding is heavier on low-end hardware, so a page full of AVIFs can feel slower on a five-year-old phone. And a JPEG from 2006 still opens in software that has never heard of AVIF.

What to expect

JPEGAVIF
Typical size vs JPEG—50–70% smaller
Transparencynoyes
Browser supporteverythingChrome, Firefox, Safari 16+
Encode speedfastslow
Decode costlowhigher on old devices
Best foruniversal deliverymodern browsers, small files

Questions

Is AVIF always better than JPEG?

For size at equal quality on photographs, usually yes. For compatibility, encode speed and old-device performance, no.

Can I just serve AVIF and drop JPEG?

You can drop it for browsers, not for everything else. Anything that reads images outside a browser — email clients, office suites, older editors — may need the JPEG.

Does converting JPEG to AVIF lose quality?

It re-encodes, so there is a small second-generation loss. Encode from the original file when you still have it.