How to Convert WebP to AVIF: Shrink Images 30% More in 2026
How to Convert WebP to AVIF: The Upgrade That Pays Off
WebP was a huge leap forward when Google introduced it in 2010 — 25-34% smaller than JPEG with transparency support. But in 2026, the web has moved on. AVIF is now the better choice for most web images, delivering files that are 20-35% smaller than equivalent WebP at the same perceptual quality. With AVIF browser support crossing 93% globally and AVIF usage growing 386% between 2022-2024, the case for upgrading your WebP images is stronger than ever.
If you have a library of WebP images and want to convert WebP to AVIF without uploading files to a server, this guide covers five free methods — starting with the fastest browser-based approach.
Why Convert WebP to AVIF? (Is It Worth It?)
Before diving into methods, here is the honest comparison of why you would make this conversion:
| Feature | WebP | AVIF |
|---|---|---|
| Compression vs JPEG | 25-34% smaller | 40-50% smaller |
| Compression vs WebP | — | 20-35% smaller |
| Browser support (2026) | 97%+ | ~93-95% |
| Transparency (alpha channel) | Yes | Yes |
| Animation support | Yes | Yes |
| HDR and wide color gamut | No | Yes |
| Encoding speed | Fast | Slower (worth it for quality) |
| Lossless compression | Yes | Yes |
| Progressive decoding | No | No |
The headline number: AVIF files are typically 20-35% smaller than WebP at equivalent visual quality. On a page with 10 images averaging 150 KB each, switching from WebP to AVIF can save 300-525 KB per page load — a meaningful improvement in LCP and Core Web Vitals scores.
When to Convert WebP to AVIF
The conversion makes clear sense in these scenarios:
When to Stick With WebP
Method 1: Convert WebP to AVIF in Your Browser (Fastest, Most Private)
The simplest way to convert WebP to AVIF is using a browser-based tool that processes your files entirely on your device using WebAssembly. Unlike server-based converters such as Convertio, CloudConvert, or Squoosh, your images never leave your computer.
Steps:
This method works on any device with a modern browser — Windows, Mac, Linux, iPhone, or Android. No software installation, no account, no file size limits. Batch conversion is supported, so you can convert multiple WebP files at once.
Why browser-based conversion matters for privacy: When you convert images using a server-based tool, your files are transmitted to a third-party server, stored temporarily (often for hours or days), and processed by infrastructure you do not control. If your WebP images contain personal photos, brand assets, or confidential visuals, browser-based conversion is the only approach that guarantees your files never leave your device.
Method 2: Convert WebP to AVIF with FFmpeg
FFmpeg is the industry-standard open-source media processing tool and handles WebP-to-AVIF conversion with precise quality control. This method is ideal for developers and users comfortable with the command line.
Installation
macOS (Homebrew):
```bash
brew install ffmpeg
```
Ubuntu/Debian:
```bash
sudo apt install ffmpeg
```
Windows: Download from ffmpeg.org/download and add to your PATH.
Single File Conversion
```bash
ffmpeg -i input.webp -c:v libaom-av1 -crf 30 -b:v 0 output.avif
```
Quality settings: The -crf flag controls quality (lower = better quality, larger file). Recommended ranges:
Batch Convert an Entire Folder
```bash
for f in *.webp; do
ffmpeg -i "$f" -c:v libaom-av1 -crf 30 -b:v 0 "${f%.webp}.avif"
done
```
Note: libaom-av1 (the AV1 encoder FFmpeg uses for AVIF) is slow for high-quality encodes. For large batches, add -cpu-used 6 to trade slight quality for significantly faster encoding:
```bash
ffmpeg -i input.webp -c:v libaom-av1 -crf 30 -b:v 0 -cpu-used 6 output.avif
```
Method 3: Convert with ImageMagick
ImageMagick is a versatile image processing suite available on all major platforms. It provides a simpler command-line syntax than FFmpeg.
Installation
```bash
brew install imagemagick # macOS
sudo apt install imagemagick # Ubuntu/Debian
```
Conversion Command
```bash
convert input.webp -quality 80 output.avif
```
The -quality parameter maps to AVIF quality (0-100, where 100 is highest quality). For web use, 75-85 strikes the right balance between file size and visual quality.
Batch Conversion
```bash
mogrify -format avif -quality 80 *.webp
```
Caution: mogrify converts in-place in the same directory. Run this command in a copy of your folder if you want to preserve the original WebP files.
Method 4: Convert WebP to AVIF with Python (Pillow)
For developers who want programmatic conversion inside an existing workflow, Python's Pillow library supports both WebP and AVIF:
```python
from pathlib import Path
from PIL import Image
def webp_to_avif(input_path: str, output_path: str, quality: int = 80) -> None:
"""Convert a WebP image to AVIF format."""
with Image.open(input_path) as img:
# Preserve transparency if present
if img.mode in ('RGBA', 'LA'):
img.save(output_path, 'AVIF', quality=quality)
else:
img = img.convert('RGB')
img.save(output_path, 'AVIF', quality=quality)
# Convert all WebP files in a directory
input_dir = Path('./webp-images')
output_dir = Path('./avif-images')
output_dir.mkdir(exist_ok=True)
for webp_file in input_dir.glob('*.webp'):
output_file = output_dir / webp_file.with_suffix('.avif').name
webp_to_avif(str(webp_file), str(output_file))
print(f"Converted: {webp_file.name} → {output_file.name}")
```
Install dependencies: pip install Pillow pillow-avif-plugin
Method 5: WordPress Plugin Workflow
For WordPress sites already serving WebP, converting your media library to AVIF can be done without touching individual files using plugins:
ShortPixel or Imagify: Both plugins support AVIF conversion for your existing media library. Configure the plugin to serve AVIF to supporting browsers and WebP as a fallback — this gives you the best of both formats simultaneously using the element.
For a complete WordPress image optimization workflow including AVIF setup, see our guide on how to optimize images for WordPress.
AVIF Quality Settings: Which Setting Should You Use?
Quality setting is the single biggest lever for balancing file size against visual fidelity. Here is what to expect from each range:
| Quality Setting | File Size (vs WebP) | Best Use Case |
|---|---|---|
| 90-100 (near-lossless) | ~5% smaller | Source files, print-ready assets |
| 80-89 | 15-25% smaller | Hero images, product photography |
| 70-79 | 25-35% smaller | Blog images, content photos |
| 60-69 | 35-45% smaller | Thumbnails, social cards |
| Below 60 | 45%+ smaller | Favicons, tiny decorative images |
Recommendation for most web use cases: quality 80. At Q80, AVIF typically produces files 25-35% smaller than equivalent WebP with no perceptible quality difference in a browser at normal viewing distances.
For transparency-heavy images (logos, UI elements, illustrations), use lossless mode — AVIF lossless compression is generally 10-15% more efficient than lossless WebP.
Serving AVIF with WebP Fallback
Once you have converted your images, serving them correctly is just as important. Use the element to serve AVIF to supporting browsers with a WebP fallback:
```html

```
This pattern serves AVIF to Chrome, Firefox, and Safari users (covering ~93% of browsers), WebP to older browsers that support it but not AVIF, and JPEG as the universal fallback for any remaining browser.
Next.js, Nuxt, Astro, and most modern frameworks handle this automatically when you use their built-in components — you only need to convert the source files.
Related Conversions
If you are optimizing an entire image pipeline, you may also need:
For the complete format landscape comparison, read our AVIF vs WebP vs JPEG guide.
Frequently Asked Questions
Is AVIF better than WebP in 2026?
For most web use cases, yes. AVIF produces files 20-35% smaller than equivalent WebP at the same visual quality, with 93-95% browser support in 2026. WebP retains an advantage in encoding speed and slightly broader compatibility with very old browsers (iOS 15 and earlier). The practical recommendation: serve AVIF to modern browsers, WebP as a fallback, using the element.
Does WebP to AVIF conversion lose quality?
Only if you use lossy compression (which is the default). At quality 80 or higher, the visual difference between the original WebP and the converted AVIF is imperceptible to the human eye in a browser. For source files or print assets, use AVIF lossless mode to preserve every pixel exactly.
How much smaller is AVIF compared to WebP?
Typically 20-35% smaller at equivalent perceptual quality. The exact savings depend on image content: photographs show the largest savings (30-40%), while graphics and images with flat colors see smaller but still meaningful reductions (10-20%). Real-world testing on diverse image sets consistently shows AVIF outperforming WebP by this margin.
Can I convert animated WebP to AVIF?
Yes. AVIF supports animation, and the browser-based converter at PhotoFormatLab's WebP to AVIF tool handles animated WebP files. Command-line tools (FFmpeg, ImageMagick) also support animated conversion. Note that animated AVIF encoding is CPU-intensive and significantly slower than static image conversion.
Is it safe to convert WebP to AVIF online?
It depends on the tool. Server-based converters (Convertio, CloudConvert) transmit your files to third-party servers. Browser-based tools like PhotoFormatLab process everything locally using WebAssembly — your files never leave your device, making them safe for personal photos, brand assets, and confidential images.
What is the best free WebP to AVIF converter?
For privacy and ease of use, browser-based tools that convert locally (no upload) are the best choice. PhotoFormatLab's WebP to AVIF converter is free, unlimited, and processes files entirely in your browser with no account required. For batch conversion of large libraries, FFmpeg with libaom-av1 gives you the most control over encoding parameters.
Jordan builds privacy-focused web tools. He created PhotoFormatLab to make image conversion free, instant, and fully browser-based — no file uploads, no accounts, no watermarks. About PhotoFormatLab →