Skip to content
Back to Blog
How-To

How to Convert PNG to AVIF: Shrink Images by 50% in 2026

April 12, 20268 min read

Converting PNG images to AVIF is one of the fastest ways to cut your website's image payload in 2026. AVIF consistently delivers 40–60% smaller files than PNG — while preserving full transparency support. Better still, Google PageSpeed Insights now flags PNG images directly and recommends AVIF as the replacement format.

This guide covers five free methods to convert PNG to AVIF, starting with the fastest: browser-based conversion that never uploads your files to a server.

Why Convert PNG to AVIF?

PNG became the web standard for lossless images with transparency. But PNG files are large — often 3–5× the size of an equivalent AVIF. In 2026, that size difference has direct consequences for page load times and Google PageSpeed scores.

What you gain by switching to AVIF:

  • 40–60% smaller file sizes compared to PNG — even at equivalent visual quality
  • Full transparency (alpha channel) support — AVIF handles it natively, just like PNG
  • Google PageSpeed boost — AVIF is the #1 format recommended by Lighthouse's "Serve images in next-gen formats" audit
  • 94.9% global browser support — Chrome 85+, Firefox 93+, Safari 16+, Edge 121+
  • HDR and wide color gamut support for modern displays
  • The trade-off? AVIF's browser support is 94.9%, not 100%. Read on to understand when to keep PNG and when AVIF is the clear winner.

    PNG vs AVIF: Key Differences

    FeaturePNGAVIF
    File SizeLarge40–60% smaller
    CompressionLossless onlyLossless + lossy
    TransparencyFull alphaFull alpha
    AnimationNo (use APNG)Animated AVIF supported
    Browser Support100%94.9%
    Color Depth8-bit / 16-bitUp to 12-bit HDR
    PageSpeed RecommendationFlaggedRecommended
    Best ForLogos, lossless archivalWeb images, photos, UI assets

    Bottom line: If your browser targets include Chrome, Firefox, Safari 16+, and Edge — AVIF outperforms PNG in almost every web use case.

    How to Convert PNG to AVIF: 5 Free Methods

    Method 1: Browser-Based Converter (Fastest — No Upload Required)

    PhotoFormatLab's PNG to AVIF converter converts your files entirely in your browser — no server upload, no file size limit, no account required. Your files never leave your device.

    Steps:

  • Go to photoformatlab.com/png-to-avif
  • Drag and drop your PNG files into the converter (or click to browse)
  • Conversion happens instantly in your browser using your device's processing power
  • Click Download to save your AVIF files
  • You can convert multiple PNG files at once — batch conversion is fully supported. The tool works on Mac, Windows, Linux, iOS, and Android without installing any software.

    This is the recommended method for designers, developers, and anyone handling sensitive or private images. Since nothing is uploaded to a server, there is zero risk of your images being stored or accessed by a third party. Read more about why browser-based conversion is safer.

    Method 2: FFmpeg (Command Line)

    FFmpeg is a free, open-source media tool with AVIF encoding support via libavif.

    Install FFmpeg:

  • Mac: brew install ffmpeg
  • Windows: Download from the official FFmpeg site and add to PATH
  • Linux: sudo apt install ffmpeg
  • Convert a single PNG to AVIF:

    ffmpeg -i input.png -c:v libaom-av1 -crf 30 output.avif

    Batch convert all PNGs in a folder (Mac/Linux):

    for f in *.png; do ffmpeg -i "$f" -c:v libaom-av1 -crf 30 "${f%.png}.avif"; done

    The -crf 30 flag controls quality — lower values mean higher quality and larger files. Values between 20–35 work well for most web images.

    Preserving transparency: Add -pix_fmt yuva420p to keep the alpha channel:

    ffmpeg -i input.png -c:v libaom-av1 -crf 30 -pix_fmt yuva420p output.avif

    Method 3: avifenc (libavif Reference Encoder)

    avifenc is the reference encoder for AVIF from the libavif project — more AVIF-native and often faster than FFmpeg for this specific task.

    Install:

  • Mac: brew install libavif
  • Linux: sudo apt install libavif-bin
  • Standard conversion:

    avifenc --min 0 --max 63 -s 6 input.png output.avif

    For true lossless output (pixel-perfect match to the PNG source):

    avifenc --lossless input.png output.avif

    The -s 6 flag sets encoding speed (0 = slowest/best, 10 = fastest). Speed 6 balances quality and time for most workflows.

    Method 4: ImageMagick

    If you already have ImageMagick installed, this is the simplest command-line approach:

    convert input.png -quality 80 output.avif

    Batch convert all PNGs in a directory:

    mogrify -format avif -quality 80 *.png

    Note: ImageMagick's AVIF support depends on how your version was compiled. Verify support by running convert -list format | grep AVIF.

    Method 5: Squoosh (Browser-Based, Manual)

    Google's Squoosh tool supports AVIF encoding in the browser and is excellent for fine-tuning quality on individual images. However, it does not support batch conversion — you can only process one file at a time.

    For converting multiple PNGs at once, PhotoFormatLab's batch PNG to AVIF converter is the faster choice.

    Does AVIF Support Transparency?

    Yes — AVIF supports full alpha channel transparency, identical to PNG. Logos, icons, UI assets, and any transparent PNG files can be safely converted to AVIF without losing the transparent background.

    PhotoFormatLab's converter handles transparency automatically with no extra configuration. When using FFmpeg, remember to include the -pix_fmt yuva420p flag to preserve the alpha channel (otherwise FFmpeg may flatten transparency to a white background).

    AVIF Browser Support in 2026

    AVIF reached 94.9% global browser support in early 2026:

    BrowserAVIF SupportSince Version
    ChromeFullChrome 85 (2020)
    FirefoxFullFirefox 93 (2021)
    SafariFullSafari 16 (2022)
    EdgeFullEdge 121 (2024)
    OperaFullOpera 71
    Samsung InternetFullVersion 14
    Internet ExplorerNo supportN/A

    For the ~5% of users on older browsers, use a element with PNG fallback:

    Description

    This delivers AVIF to the 94.9% who can use it, while falling back to PNG for everyone else — full compatibility with zero compromise.

    AVIF Quality vs File Size: What to Expect

    When converting from PNG (lossless) to AVIF (lossy), the file size reduction depends on the quality setting you choose:

    Quality SettingTypical File Size vs PNGRecommended For
    Lossless10–30% smallerArchival, pixel-perfect reproduction
    Quality 9040–50% smallerHigh-fidelity product images, UI screenshots
    Quality 7555–65% smallerMost web images — sweet spot
    Quality 6065–75% smallerBackground images, decorative graphics
    Quality 4075–85% smallerThumbnail previews, social previews

    For most web use cases, quality 75–80 hits the sweet spot between file size reduction and visual fidelity. At this setting, the difference from the original PNG is imperceptible to the human eye.

    When Should You Keep PNG Instead?

    AVIF wins in most web scenarios, but PNG remains the right choice when:

  • You need pixel-perfect lossless reproduction for scientific, medical, or archival images
  • Your audience includes Internet Explorer users (< 1% globally in 2026)
  • You're creating source files for further editing — always keep PNG/TIFF masters
  • The image is a detailed screenshot with small text — PNG's lossless compression preserves text sharpness better than lossy AVIF
  • Your CMS or platform does not support AVIF uploads yet (some legacy systems still only accept JPG/PNG)
  • For everything else — photos, illustrations, product images, hero images, blog graphics — AVIF delivers meaningfully better results.

    Integrating AVIF Into Your Web Workflow

    Once you've converted your PNG files to AVIF, here's how to integrate them:

    1. Use for progressive enhancement:

    Serve AVIF to supported browsers with automatic fallback to PNG for older ones.

    2. Update your WordPress setup:

    If you're using WordPress, optimize your image workflow to serve AVIF automatically from your media library.

    3. Run PageSpeed after converting:

    After replacing PNG with AVIF on your pages, run Google Lighthouse or PageSpeed Insights. You should see the "Serve images in next-gen formats" warning disappear and your Performance score improve.

    4. Set correct Content-Type headers:

    Make sure your server or CDN serves AVIF files with the correct MIME type: image/avif. Most modern hosts handle this automatically.

    For a deeper look at serving the right format to the right browser, see our guide on best image formats for websites in 2026.

    Frequently Asked Questions

    Q: Does converting PNG to AVIF reduce quality?

    A: AVIF supports both lossless and lossy compression. For lossless conversion (pixel-perfect match to the original PNG), use avifenc --lossless or select lossless mode in your converter. For web delivery, a slight quality reduction (typically imperceptible) is traded for 40–60% smaller files. At quality settings between 75–85, the visual difference from the original is undetectable at normal viewing distances.

    Q: How much smaller will my AVIF files be compared to PNG?

    A: On average, AVIF files are 40–60% smaller than equivalent PNGs. A 500KB PNG typically becomes a 200–280KB AVIF at quality 75. The savings are largest on photographic and gradient-heavy images, and smaller on images with large flat color areas like simple logos or icons.

    Q: Is it safe to convert PNG to AVIF online?

    A: It depends on the tool. Server-based converters upload your files to external servers — a privacy risk for sensitive images. PhotoFormatLab converts entirely in your browser so your files never leave your device. Learn more in our guide on converting images without uploading to a server.

    Q: Can I batch convert multiple PNGs to AVIF at once?

    A: Yes. PhotoFormatLab supports batch conversion — drag in multiple PNG files and download them all as AVIF in one step. The batch PNG to AVIF converter is designed for converting entire image folders without any file count limits.

    Q: Does AVIF preserve transparent backgrounds from PNG?

    A: Yes. AVIF fully supports alpha channel transparency. All transparent areas in your PNG source will be preserved in the AVIF output. PhotoFormatLab handles this automatically. When using FFmpeg on the command line, add the -pix_fmt yuva420p flag to ensure the alpha channel is preserved.

    Q: Will converting PNG to AVIF improve my Google PageSpeed score?

    A: Yes, typically. Google's Lighthouse audit flags PNG images under "Serve images in next-gen formats" and specifically recommends AVIF. Replacing PNG with AVIF reduces your total image payload, which directly improves your Largest Contentful Paint (LCP) and overall Performance score. The improvement is most noticeable on pages with multiple large PNG images. After converting, always include a PNG fallback using the element to maintain compatibility.

    Ad
    Ad