JPEG, PNG, WebP or AVIF: which one to actually use

By Filewhisk Team Published Updated

Measured sizes for the same photo in four formats, and the cases where the smallest file is the wrong answer.

Format comparisons usually end with “AVIF is smallest, use AVIF”. Size is the easiest thing to measure and often the least important thing about the choice. Here are the numbers first, then the cases where the smallest file is the wrong file.

The measured part

One photo — Track on Fremington Edge by Kreuzschnabel (CC BY-SA 3.0) — resized to 2048 px wide, then encoded three ways on the same machine: JPEG and WebP by Chrome 153's built-in encoders, AVIF by the WebAssembly encoder this site uses in JPG to AVIF.

FormatSizevs JPEG
JPEG, quality 80734 KB—
WebP, quality 80626 KB−15%
AVIF, default setting583 KB−21%

Those are honest gains, not the 50% figures that get quoted. Large savings from AVIF are real, but they show up mostly on flat graphics, illustrations and images with large smooth areas — not on a detailed landscape, where every format has to spend bytes on grass and stone. Treat “AVIF is half the size” as a claim about the best case, not about your photo.

What each format is for

FormatBest atCannot do
JPEGPhotographs; the format every device, printer and form acceptsTransparency; sharp text and flat colour without artefacts
PNGScreenshots, logos, line art, anything with text or hard edges; lossless; transparencyCompact photographs — a PNG photo is typically 3–5× a JPEG
WebPWeb images: smaller than JPEG, does transparency and animationReliable support outside browsers — some desktop software and printers still refuse it
AVIFThe smallest files for web delivery, especially flat graphics; transparency; wide colourBeing created anywhere but a browser or a modern encoder; slow to encode

The rule that decides most cases

Ask where the file is going, not which format is best in the abstract:

A detail nobody mentions: browsers can read AVIF but not write it

Every current major browser displays AVIF. None of them can create one from a canvas: ask a browser to encode AVIF and it quietly hands back a PNG instead, with no error to tell you it substituted the format. We hit this while building the converters on this site and had to check the returned file's type rather than trust the request.

That is why every browser-based AVIF converter, including this one, ships a WebAssembly encoder of its own — roughly three megabytes that has to be downloaded before the first conversion. It is also why AVIF encoding is noticeably slower than JPEG or WebP: you are running a video codec's intra-frame encoder on a still image.

Converting between formats: what is kept and what is lost

ConversionWhat happens
PNG → JPEGTransparent areas get filled with a colour you choose; file usually shrinks a lot; edges of text soften
JPEG → PNGFile usually grows several times over. PNG is lossless, but it cannot undo the JPEG artefacts already baked in
JPEG → WebP / AVIFSmaller file, but a second round of lossy encoding on top of the first. Fine for publishing, not for archiving
Anything → JPEGMetadata, animation and transparency are dropped; colour profile may be flattened to sRGB
HEIC → JPEGThe usual reason: HEIC is what iPhones save and what most Windows software cannot open

One rule covers all of them: never convert your only copy. Lossy formats cannot be reversed, and a conversion made to satisfy one website will still be the file you have in five years.

Quality numbers are not comparable across formats

“Quality 80” in JPEG and “quality 80” in WebP are different settings on different scales; they only look alike. In the measurement above, both were set to 80 and WebP came out 15% smaller — which tells you about the encoders' defaults, not that WebP 80 and JPEG 80 look identical. If you are matching quality rather than a number, compare the two results side by side at full size, and pick by eye.

The same caution applies to any comparison table on the web, including this one: it is one photo, one encoder version, one set of settings. It is a starting point, not a law. Convert Image Format will do the same comparison with your own image in a few seconds, and nothing is uploaded while you try it.

Tools used in this guide