How to Convert PNG to AVIF: Shrink Images by 50% in 2026
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:
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
| Feature | PNG | AVIF |
|---|---|---|
| File Size | Large | 40–60% smaller |
| Compression | Lossless only | Lossless + lossy |
| Transparency | Full alpha | Full alpha |
| Animation | No (use APNG) | Animated AVIF supported |
| Browser Support | 100% | 94.9% |
| Color Depth | 8-bit / 16-bit | Up to 12-bit HDR |
| PageSpeed Recommendation | Flagged | Recommended |
| Best For | Logos, lossless archival | Web 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:
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:
brew install ffmpegsudo apt install ffmpegConvert 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:
brew install libavifsudo apt install libavif-binStandard 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:
| Browser | AVIF Support | Since Version |
|---|---|---|
| Chrome | Full | Chrome 85 (2020) |
| Firefox | Full | Firefox 93 (2021) |
| Safari | Full | Safari 16 (2022) |
| Edge | Full | Edge 121 (2024) |
| Opera | Full | Opera 71 |
| Samsung Internet | Full | Version 14 |
| Internet Explorer | No support | N/A |
For the ~5% of users on older browsers, use a element with PNG fallback:

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 Setting | Typical File Size vs PNG | Recommended For |
|---|---|---|
| Lossless | 10–30% smaller | Archival, pixel-perfect reproduction |
| Quality 90 | 40–50% smaller | High-fidelity product images, UI screenshots |
| Quality 75 | 55–65% smaller | Most web images — sweet spot |
| Quality 60 | 65–75% smaller | Background images, decorative graphics |
| Quality 40 | 75–85% smaller | Thumbnail 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:
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.