Skip to content
Back to Blog
How-To

How to Convert WebP to AVIF: Shrink Images 30% More in 2026

Jordan Webb·April 15, 20268 min read

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:

FeatureWebPAVIF
Compression vs JPEG25-34% smaller40-50% smaller
Compression vs WebP20-35% smaller
Browser support (2026)97%+~93-95%
Transparency (alpha channel)YesYes
Animation supportYesYes
HDR and wide color gamutNoYes
Encoding speedFastSlower (worth it for quality)
Lossless compressionYesYes
Progressive decodingNoNo

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:

  • Performance-focused websites — Every kilobyte saved improves LCP and reduces bounce rate
  • Large image libraries — If you have thousands of WebP files, the cumulative storage and bandwidth savings are substantial
  • E-commerce product images — Faster-loading product images correlate directly with higher conversion rates
  • Photography portfolios — AVIF preserves more subtle tonal detail at the same file size
  • When to Stick With WebP

  • When you need Safari support for very old versions (iOS 15 and earlier do not support AVIF)
  • When your image pipeline already serves WebP and re-encoding adds operational complexity
  • For animated images where AVIF encoding is too slow for your workflow
  • 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:

  • Open PhotoFormatLab's WebP to AVIF converter
  • Drag and drop your WebP files onto the upload zone (or click to browse)
  • Adjust the quality slider if needed — 80-85% is recommended for web use
  • Click Convert to AVIF
  • Download your AVIF files individually or as a ZIP archive
  • 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:

  • 18-23: Near-lossless, excellent for product photography and detailed images
  • 28-33: High quality, best balance for most web use cases
  • 35-45: Smaller files, suitable for thumbnails and preview images
  • 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 SettingFile Size (vs WebP)Best Use Case
    90-100 (near-lossless)~5% smallerSource files, print-ready assets
    80-8915-25% smallerHero images, product photography
    70-7925-35% smallerBlog images, content photos
    60-6935-45% smallerThumbnails, social cards
    Below 6045%+ smallerFavicons, 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

    Description of image

    ```

    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:

  • Convert JPG to AVIF — Upgrade JPEG files to AVIF for maximum compression
  • Convert PNG to AVIF — Replace lossless PNGs with efficient AVIF files
  • Convert AVIF to WebP — Go back to WebP if you need broader compatibility
  • Convert AVIF to JPG — Convert AVIF to JPEG for maximum universal compatibility
  • 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.

    J
    Jordan Webb·Founder, PhotoFormatLab

    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 →

    Ad
    Ad