WebP vs AVIF

AVIF is smaller again; WebP encodes faster and is supported further back.

Choose WebP when

When encoding time matters — a site generating thumbnails on upload — or when you need support in older browsers and tools without a fallback.

Choose AVIF when

For the smallest file at a given quality, especially on photographs, and for wide colour and high dynamic range, which WebP cannot carry.

The thing that catches people out

AVIF encoding is slow, sometimes by an order of magnitude. That is invisible for one image and very visible for ten thousand.

Switching from WebP to AVIF

What survives

Nothing is discarded. WebP and AVIF both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Transparency survives. Both WebP and AVIF store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Animation survives. WebP and AVIF both hold multiple frames, so the result moves rather than freezing on the first one.

Opening the result

Current browsers read AVIF; older ones do not. It is the less portable of the two, so it is worth being sure the program at the other end accepts it before sending one.

AVIF is a container rather than a single format. What actually plays is the codec inside it — usually AV1 — which is why two files with the same extension can behave differently on the same device.

GIMP and Squoosh read both WebP and AVIF, so there is a way to check the result against the original without a second tool.

What each format is for

WebP is Google's format, published in 2010. It records 8 bits per channel.

AVIF comes from Alliance for Open Media and dates from 2019, specified as AV1 Image File Format. GIMP, Squoosh and ImageMagick all read it.

Switching from AVIF to WebP

What is lost

AVIF carries up to 12 bits per channel and WebP stores 8. The extra precision is what survives heavy correction without banding, so the conversion is best made after the editing rather than before it.

What survives

Nothing is discarded. AVIF and WebP both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Transparency survives. Both AVIF and WebP store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Animation survives. AVIF and WebP both hold multiple frames, so the result moves rather than freezing on the first one.

Opening the result

WebP opens in every current browser. AVIF has narrower browser support than that. If the file is going onto a web page or into a form, that is usually the whole reason for the conversion.

GIMP and Squoosh read both AVIF and WebP, so there is a way to check the result against the original without a second tool.

What each format is for

AVIF is Alliance for Open Media's format, published in 2019. It records 12 bits per channel.

WebP comes from Google and dates from 2010, specified as RFC 9649. Adobe Photoshop, GIMP and Squoosh all read it.

What WebP to AVIF actually does

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as WebP.

WebP14 KB

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as AVIF.

AVIF17 KB20% larger

A photographic scene — smooth gradients, soft edges, grain. This is the case AVIF is designed for or against, and the figures show which. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as WebP.

WebP4 KB

A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as AVIF.

AVIF3 KB21% smaller

A transparent background and a gradient across the shape. AVIF either keeps both, keeps one, or fills the transparency with a solid colour — which is the difference that catches people out. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as WebP.

WebP11 KB

A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as AVIF.

AVIF5 KB2.1× smaller

Flat colour and hard edges, as in an interface, a chart or a logo. Very different behaviour from the photograph above, and the reason the answer is "it depends what is in the file". Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.

Side by side

WebP and AVIF compared row by row: what each stores, and what it costs.
WebPAVIF
Full nameWebP ImageAV1 Image File Format
Extension.webp.avif
Media typeimage/webpimage/avif
CompressionEither, depending on the settingEither, depending on the setting
This site can write itYesYes

Two generations of the same idea

Both take a modern video codec and use it on a single frame. WebP is a still from VP8, published by Google in 2010. AVIF is a still from AV1, published by the Alliance for Open Media in 2019 — a consortium including Google, Netflix, Amazon, Mozilla and Apple, formed specifically to build a codec nobody had to pay for.

Nine years of codec research separate them, and it shows in the file sizes. Both are royalty-free, which is the property that made either of them possible and which distinguishes both from HEIC, technically AVIF’s closest relative.

AVIF is smaller on photographs, and not on everything

On photographic content the advantage is clear: typically twenty to thirty per cent below a WebP of comparable quality, and more at aggressive settings. It also handles the cases WebP struggles with — smooth gradients, night skies, subtle skin tones — with much less banding, because it is not limited to eight bits per channel.

On flat interface graphics, icons, screenshots and line art the picture reverses. Those compress extremely well already, and AVIF frequently produces a larger file than WebP for the same image. This site’s own measured comparison shows exactly that: AVIF twice as small on a photograph and noticeably larger on flat colour with hard edges. Convert five representative images of your own before believing any general claim, including this one.

Encoding cost is the practical difference

AVIF encoding is expensive — often an order of magnitude slower than WebP for the same image, because AV1 searches much harder for structure it can describe compactly. A large photograph can take several seconds on a fast machine.

For a static site built once, that is irrelevant: the cost is paid on your computer and every visitor benefits. For a platform processing user uploads in real time, it is a capacity question with a bill attached, and it is the main reason services adopted WebP years before AVIF and still generate both.

What each carries beyond the picture

Both support transparency with a real alpha channel and both support animation, so neither is limited to still opaque images.

AVIF adds what a modern display can show: ten and twelve bits per channel, wide colour gamuts, and high dynamic range. WebP is capped at eight bits in a standard gamut, which is fine for the great majority of web imagery and is a genuine limitation for photography intended to look its best on a good screen.

One historical footnote worth knowing: WebP’s lossless mode is excellent and widely used, while AVIF’s exists and is less well supported by tooling. For a lossless asset, WebP is usually still the more practical choice.

Support is not the deciding factor any more

Both are read by every current browser. WebP has a longer tail of support in non-browser software — image viewers, editors, some content systems — simply by being older, and neither can be relied on outside a browser. Email a WebP or an AVIF and you have the same problem.

So the choice is not about compatibility between these two. It is about what the images are, what the encoding costs, and whether the pipeline can produce two formats instead of one.

What to actually do

Serve both. A picture element with an AVIF source first, a WebP source second and a JPG or PNG fallback lets every browser take the best it can read, and it is the arrangement that needs no detection and no maintenance.

If only one, choose by content. A photography portfolio, an e-commerce catalogue, a travel site: AVIF, where the saving is largest and the banding improvement is visible. An application interface, a documentation site, anything mostly screenshots and diagrams: WebP, which will often produce smaller files and always encode faster.

Keep the originals

Both are lossy at their default settings, and both are delivery formats. Converting an existing JPG to either re-encodes an already lossy image and compounds the damage — generate from the master where one exists.

And keep the masters. The reason this comparison exists is that a better format arrived nine years after the last one, and the same will happen again. An asset library kept losslessly can produce whatever comes next; one that has been converted in place can only produce copies of a copy.

WebP or AVIF: common questions

Is AVIF always smaller than WebP?

No. On photographs it is typically 20 to 30 per cent smaller and handles gradients with far less banding. On flat interface graphics, icons and screenshots it is frequently larger, because that content already compresses extremely well.

Do both work in all browsers?

Yes, every current browser reads both. Compatibility is no longer what separates them — the differences that matter are file size by content type, encoding cost, and colour depth.

Why is AVIF encoding so slow?

AV1 searches much harder for compressible structure than VP8 does, often an order of magnitude slower for the same image. That is irrelevant for a site built once and a real capacity cost for a platform processing uploads in real time.

Which should I use if I can only pick one?

Choose by content. Photography, e-commerce and travel sites benefit most from AVIF. Application interfaces, documentation and anything mostly screenshots are usually better served by WebP, which also encodes far faster.

Do they support transparency and animation?

Both do, with a real alpha channel and animation support. AVIF additionally carries 10 and 12 bits per channel, wide colour and high dynamic range, where WebP is capped at 8 bits in a standard gamut.

How does AVIF compare with HEIC?

Technically they are close relatives — both are still frames of a modern video codec — and the decisive difference is licensing. HEIC’s codec sits behind patent pools, which is why Safari, since version 17, is the only browser that displays it. AVIF is royalty-free, which is why all of them do.

Decided? Convert it here

Where these figures come from

The claims this page makes about WebP and AVIF are checkable, and these are the documents that settle them.