HexaConverter
Images5 min read

WebP or AVIF: choosing a modern image format

Both beat JPEG comfortably. They differ in how much they beat it by, how long they take to produce, and what will refuse to open them.

JPEG is thirty-four years old and PNG is not far behind. Both are still excellent at their jobs, and both are comfortably beaten on file size by formats designed with several more decades of research behind them.

The two realistic modern choices are WebP and AVIF. They are not really competitors at the same point on the curve — one is the safe upgrade and the other is the aggressive one — and the right answer depends more on what will open your files than on which compresses better.

What each one is

WebP came out of Google in 2010, built from the VP8 video codec, and was designed to replace both JPEG and PNG at once. It compresses either lossily or losslessly, supports transparency in both modes, and can animate. That combination is its real strength: one format covering photographs, graphics, transparency and short animations.

AVIF is newer and derived from AV1, a much more modern video codec. It compresses harder than WebP at the same visual quality, handles wide colour gamut and high dynamic range, and also supports transparency and animation. It is the more capable format on nearly every technical axis.

Both are lossy by default and lossless if you ask, which makes the old JPEG-or-PNG decision largely unnecessary — you no longer have to choose a format to get transparency.

The size difference in practice

Rough figures, for a photograph at visually comparable quality. Treat them as orders of magnitude rather than precise ratios, because the actual numbers depend heavily on the image.

FormatRelative sizeNotes
JPEG100%The baseline everything is measured against
WebP65–75%A consistent, dependable improvement across most images
AVIF40–60%Larger gains, and the gap widens at lower quality settings

Support is the real deciding factor

Browser support for both is now essentially universal — every current browser handles WebP and AVIF. That is not where the problem is.

The problem is everything that is not a browser. Desktop image editors, print workflows, older phones, corporate document systems, the software your client uses, the photo frame your relative owns. WebP has had fifteen years to work its way into these and is now widely, though not completely, supported. AVIF is younger and the gaps are correspondingly larger.

So the practical rule is about destination rather than format quality. If the image is going onto a web page you control, either works and AVIF saves more. If you are handing the file to somebody else — a client, a printer, another company's system — the older, more boring format is very often the correct engineering choice.

AVIF is slow to produce

AVIF encoding comes from a video codec, and video codecs are computationally expensive. Encoding an AVIF takes noticeably longer than encoding a JPEG, a PNG or a WebP — this is inherent to the format, not a limitation of any particular tool.

For a handful of images it does not matter. For a batch of several hundred it very much does, and it is worth knowing before you start. Decoding, by contrast, is fast enough that viewers will not notice anything.

Our defaults reflect the difference: converting to WebP uses quality 82, and converting to AVIF uses quality 60. Those numbers are not comparable with each other, which is worth stressing — 60 on AVIF's scale is a visually higher setting than the number suggests, and setting AVIF to 82 produces a much larger file than you probably intended.

A quality number means nothing on its own

This is the single most common mistake when moving between formats. Quality settings are not a shared scale. They are each codec's own internal dial, and the same number means different things in different formats.

JPEG at 82 and WebP at 82 land in broadly similar territory, which is why those two are often given the same default. AVIF at 82 is a substantially higher quality target than either — you would be spending a great deal of file size to preserve detail nobody can see.

The useful habit is to judge by result rather than by number. Convert one representative image, look at it at the size it will actually be displayed, and adjust from there. A number that worked in one format is not evidence about another.

What to actually do

For most people the answer is WebP. It is a real improvement over JPEG and PNG, it handles transparency and animation, it encodes quickly, and by now very little will refuse to open it. It is the upgrade with the fewest ways to go wrong.

Choose AVIF when bandwidth genuinely matters and you control the destination — a high-traffic site, a mobile-first product, a large gallery of photographs. The extra saving is real and worth having at scale.

Keep JPEG and PNG when you are handing a file to someone else's workflow, when a client or printer has specified them, or when the recipient is unknown. Converting WebP back to PNG is straightforward when you need to hand over something conventional — remembering that a lossy WebP cannot become lossless again, only stored losslessly from here on.

Common questions