WebP vs AVIF: what AVIF is and when it is worth it
AVIF often makes photos around half the size of JPEG, but it is slow to encode and not accepted everywhere. How it compares with WebP and when to use each.
Image formats · 2 min read · Updated
What AVIF is
AVIF (AV1 Image File Format, 2019) stores still images using the AV1 video codec. It supports lossy and lossless compression, transparency, high dynamic range and 10 and 12-bit colour. At similar visual quality, AVIF files are often around half the size of JPEG.
How it compares with WebP
- File size: AVIF is usually smaller than WebP for photos, especially at low and medium quality.
- Look at low quality: AVIF tends to smooth away fine texture such as grass, fabric and skin, while WebP tends to blur and show blocks.
- Speed: AVIF is much slower to encode, especially on phones. WebP is quick.
- Support: both display in current Chrome, Edge, Firefox and Safari, with AVIF needing Safari 16 or later. Older software is more likely to open WebP than AVIF.
- Features: AVIF supports HDR and higher bit depths. WebP is limited to 8-bit colour.
Quality numbers are not comparable
AVIF quality settings run lower than JPEG and WebP for the same look. Around 55 to 65 already looks excellent for most photos. Copying a JPEG quality number such as 85 to AVIF gives files that are larger than they need to be.
Why encoding takes a while
Aback Images encodes AVIF with libavif compiled to WebAssembly, loaded only when you choose AVIF as the output. The work happens on your device, so a large photo can take several seconds on a laptop and noticeably longer on a phone. That is the trade-off for never uploading the image.
Which one to use
- Your own website: serve AVIF with a WebP or JPG fallback through the picture element.
- Quick conversions, or when encoding time matters: WebP.
- Files sent to other people or uploaded to forms: JPG, which almost every system accepts. AVIF to JPG converts AVIF files you received.
- Not sure: Format Shoot-out encodes all three at the same visual quality and keeps the smallest.
Tools in this guide
- Convert to AVIFConvert any image (HEIC, PNG, WebP, AVIF, RAW, PSD, SVG and 26 more) to AVIF in bulk, right in your browser.
- JPG to AVIFConvert JPG to AVIF in your browser, ready for maximum compression on modern websites. Batch, private, no uploads.
- PNG to AVIFConvert PNG to AVIF in your browser, ready for maximum compression on modern websites. Batch, private, no uploads.
- AVIF to JPGConvert AVIF to JPG in your browser, with transparency filled in a colour you pick. Batch, private, no uploads.
- Compress AVIFEncode AVIF at the size and quality you want using the AV1 encoder compiled to WebAssembly.
- Format Shoot-outNewEncodes your image as JPG, WebP and AVIF at the same visual quality and keeps the smallest one.
Related guides
- WebP vs JPG: is it time to switch?
- JPG vs PNG: which format should you use?
- What is HEIC, and how do you open it on Windows or the web?
- What is JPEG XL, and can you use it yet?