WebP vs AVIF: which should you use?

A direct answer, a property comparison, measured file sizes and when to pick each format.

Short answer: WebP or AVIF?

Use WebP when you need a modern image format that nearly every browser, app and upload form accepts, that encodes quickly and that handles photos, transparency and animation in one file type. Use AVIF when the priority is the smallest possible file for photographs and graphics on the web and you can accept slower encoding and less support in older software. If a file has to open everywhere, including in old programs, JPG or PNG is still the safe choice.

WebP and AVIF compared

PropertyWebPAVIF
CompressionLossy or losslessLossy or lossless
TransparencyYesYes
AnimationYesYes
File extensions.webp.avif
MIME typesimage/webpimage/avif
Developed byGoogleAlliance for Open Media
First released20102019
What opens itWebP opens in current Chrome, Firefox, Edge and Safari (from Safari 14), on Android, and in editors such as GIMP and recent versions of Photoshop.AVIF opens in current Chrome, Firefox, Safari and Edge, on Android 12 and later, and in recent versions of GIMP.

Measured file sizes

These are file sizes we measured with NexMedia's own conversion engines, not estimates. In our test of 4 images, every file was converted at NexMedia's default settings, and each cell is the size of the file the converter produced.

Output size of each sample image
SamplePNG source fileWebP (default settings)AVIF (default settings)
Photograph A (Kodak test set)503 kB35.1 kB47.5 kB
Photograph B (Kodak test set)558 kB32.4 kB46.3 kB
Screenshot of a web application37.2 kB18.9 kB15.7 kB
Flat-colour cartoon illustration269 kB9.8 kB10.2 kB
All samples together1.37 MB96.3 kB120 kB

Across all 4 images together, AVIF (default settings) came to 124% of the size of WebP (default settings).

AVIF (default settings) was smaller than WebP (default settings) for 1 of the 4 images.

The samples

How this was measured

Engines: libvips 8.14.1 for images and ffmpeg 5.1.9-0+deb12u1 for audio and video, the builds inside NexMedia's conversion worker image. Measured on November 12, 2026.

Image settings were NexMedia's defaults: quality 82, with the lossless option off except where a column says lossless mode. The PNG column is a PNG written by NexMedia's converter (the source PNG went through a lossless TIFF step first), so it reflects NexMedia's PNG encoder rather than the tool that made the original file.

Progressive (interlaced) output is on by default, which typically makes PNG files larger than the same pixels saved without interlacing.

Quality is not measured here. A smaller file is not a better file: encoders trade size against detail differently, and the same quality number means different things in different codecs. Only lossless and uncompressed outputs keep every detail of the data they were given.

Results depend on the content of each file, so other files can give different sizes. Treat these numbers as one reproducible test, not as a rule.

When to choose which

  • Photos on a website

    Both formats usually weigh less than the same photo as a JPG. AVIF tends to pay off most on large, detailed photos, while WebP is quicker to produce and easier to deliver everywhere. Many sites serve AVIF first and fall back to WebP or JPG. Compare the two files by eye rather than by the quality slider, because the same quality number means different things in each encoder.

  • Logos, icons and screenshots

    Lossless WebP or PNG keeps edges and flat colours exact, and WebP can be smaller than PNG for the same pixels. AVIF can also be lossless, but it is mostly chosen for photographic content.

  • Transparency and animation

    Both can hold a transparent background and an animation. Animated WebP has been supported by browsers for longer, so it is the safer replacement for a GIF today.

  • Sending files to other people or editing them

    Some editors, image viewers and upload forms still reject AVIF, and a few reject WebP. When the file is going to a client, a printer or an older program, convert it to JPG or PNG instead.

The formats

Convert between them

Converter and compression tools

More comparison guides

Frequently asked questions

Is AVIF better than WebP?

AVIF is the newer format and its encoder can reach smaller files for many photographs, but it is slower to encode and not accepted everywhere. WebP is faster and more widely supported. Which one is better depends on whether the smallest file or the widest compatibility matters more to you.

Do all browsers support WebP and AVIF?

Current versions of Chrome, Edge, Firefox and Safari open both formats. Older browser releases may not open AVIF, and the oldest may not open WebP, so sites that must reach everyone keep a JPG or PNG fallback.

Does AVIF always give a smaller file than WebP?

No. It depends on the image and on the encoder settings. The measured section above shows what happened for our samples at NexMedia's default settings; other images can come out differently.

Can I convert between WebP and AVIF with NexMedia?

Yes. NexMedia can convert WebP to AVIF and AVIF to WebP. The conversion re-encodes the image, so repeated conversions between lossy formats can add small losses.