JPEG vs WebP vs AVIF: Which Format Should You Use?

For photographs published on a website, WebP is the sensible default: it produces smaller files than JPEG at the same visual quality, keeps transparency, and every current browser displays it. AVIF compresses further, but it encodes slowly and older software still cannot open it. JPEG remains the right choice for email attachments, print handoffs and any file that has to open in a program written before 2010.

That short answer covers most cases. The rest of this guide explains what each format does to your pixels, where the trade-offs actually bite, and how to test the result instead of trusting a number.

Why the format matters more than the quality slider

A quality slider on a compressor controls how aggressively one specific encoder throws information away. It does not tell you which encoder you are using. Two files saved at “quality 80” can differ by 40% in size if one is JPEG and the other WebP, because the two codecs make different decisions about what the human eye will notice.

The bigger issue is generation loss. Every time a lossy format is decoded and re-encoded, small errors accumulate. A photo that has been saved five times at quality 85 looks worse than the same photo saved once at quality 75. This is why the practical rule is to keep one untouched original and generate every delivery copy from it, rather than editing a JPEG that was already compressed.

How each format stores pixels

JPEG

JPEG splits the image into 8×8 pixel blocks, converts each block to a frequency representation, and discards the high-frequency detail that human vision is least sensitive to. It stores brightness at full resolution but colour at reduced resolution (chroma subsampling), which is invisible in skin tones and landscapes and very visible in saturated red text on a white background. JPEG has no alpha channel: transparent areas become a solid colour, usually white or black depending on the encoder.

Its advantage is not technical, it is social. Every operating system, browser, photo frame, printer, slide deck and email client made in the last three decades reads JPEG. If you need a file to simply work, JPEG works.

WebP

WebP ships two encoders in one container: a lossy mode derived from VP8 video compression, and a true lossless mode. Both support an alpha channel, and the container also supports animation. In practice a WebP photograph is usually 25–35% smaller than the same JPEG at matched visual quality, and a lossless WebP screenshot is often considerably smaller than the equivalent PNG.

Support is the reason it can be a default rather than an experiment: Chrome, Firefox, Edge and Safari have all decoded WebP for years, and so do current image editors, design tools and content management systems. The remaining gaps are old email clients and some document converters, which is exactly where JPEG still earns its place.

AVIF

AVIF wraps an AV1 still image. It is the strongest of the three at low bitrates: large photos, gradients, and images with film grain compress remarkably well, and it supports alpha, HDR and wide colour. The cost is encode time — a single 4000-pixel photo can take seconds rather than milliseconds — and compatibility. Current versions of the major browsers display AVIF, but plenty of installed software, older phones and office suites do not.

There is a second, quieter cost: because AVIF smooths detail so aggressively, faces and textures can look slightly plastic at aggressive settings. It rewards careful quality tuning rather than a single global number.

A decision table you can actually use

What you haveBest first choiceFallbackWhy
Photo on a web pageWebPJPEGSmaller than JPEG, universally supported in browsers
Screenshot or UI mockupWebP losslessPNGSharp edges and text survive; JPEG would smear them
Logo or icon with transparencyWebP or PNGAVIFNeeds an alpha channel and clean edges
Email attachmentJPEGPNGMail clients and old software are unpredictable
Print or press handoffTIFF or PNGHigh-quality JPEGPrint workflows expect lossless or near-lossless input
Very large photo galleryAVIF with WebP fallbackWebPBandwidth matters more than encode time

Quality settings that hold up

For JPEG and WebP, quality 75–85 is the useful band for photographs. Below 70 you start seeing blocking in skies and halos around high-contrast edges; above 90 file size climbs steeply for detail nobody will see at normal viewing size. Because the scales are not comparable across codecs, do not assume AVIF at “quality 80” looks like WebP at 80. AVIF reaches similar visual quality at a lower number, so tune it separately and check the result at 100% zoom.

Two settings matter as much as the quality number and are easy to forget:

  • Dimensions. Halving the longest edge cuts pixel count by roughly 75%. For a 4000-pixel camera file displayed at 800 pixels wide, resizing does more for file size than any quality tweak, and it looks better than an over-compressed full-size image.
  • Metadata. Camera files carry EXIF blocks, colour profiles and sometimes a thumbnail. Some encoders copy them, some strip them. Stripping them saves kilobytes and removes GPS coordinates you may not want to publish.

The re-encoding trap

Converting a JPEG to WebP does not recover detail the JPEG already discarded. You get a smaller file carrying the same damage. That is fine for delivery — it is not a restoration. If a file looks soft before conversion, it will look soft after, and converting back to JPEG later will add a second layer of damage.

The workable habit is simple: keep the camera original or exported master in a folder you never publish, and treat compressed copies as disposable artifacts you can regenerate whenever a better encoder appears. AVIF is a good example. Files you compressed to WebP two years ago could now be smaller as AVIF, and that upgrade is painless if the masters still exist.

How to compare formats on your own files

Generic advice goes only so far, because the winner depends on your content. A practical test takes a few minutes:

  1. Pick three representative images: one photo with sky or skin, one screenshot with small text, one graphic with transparency.
  2. Export each in all three formats at the same pixel dimensions and a quality you would actually ship.
  3. Note the file sizes, then open the results at 100% zoom next to the original.
  4. Look at the places compression fails first: gradients, thin lines, sharp edges against flat colour, and small text.
  5. Pick the smallest file that shows no artifact you can spot without hunting for it.

You can run that comparison in the PixelPress compressor: load the same image, switch the output format, and read the before-and-after size on each card. Because the conversion happens in your browser, nothing is uploaded while you experiment.

FAQ

Does converting a JPEG to WebP make the image worse?

It cannot make it better. The conversion decodes the existing JPEG and re-encodes it, so the first round of compression damage stays and a small amount of new error is added. At quality 80 or above the difference is usually invisible, but it is not free. Convert once from the best source you have.

Which format should I use for a logo?

If the logo has flat colours and needs transparency, use PNG or lossless WebP. If it is displayed on a website and you control the markup, WebP will usually be smaller. Avoid JPEG for logos: the block-based compression produces visible halos around letterforms, especially on coloured backgrounds.

Can I just use PNG for everything?

You can, and your pages will be slow. PNG is lossless, so a photograph stored as PNG can be five to ten times larger than the same photo as WebP. PNG is the right tool for screenshots, line art and transparency, not for photographic content.

Written by the PixelPress team. Last updated November 19, 2026.

Next: how to hit a 100 KB file-size limit →