AVIF
Learn what AVIF is, how this next-generation image format improves page speed and Core Web Vitals, and when to use it over WebP or JPEG.
AVIF (AV1 Image File Format) is a modern image format based on the AV1 video codec. It delivers significantly smaller file sizes than JPEG, PNG, and even WebP at equivalent visual quality. AVIF supports both lossy and lossless compression, HDR, wide color gamut, and transparency — making it one of the most versatile image formats available for the web today.
Why It Matters for SEO
Image weight is one of the largest contributors to page load time, and page speed is a direct ranking factor. Switching to AVIF can reduce image file sizes by 50% or more compared to JPEG, which directly improves Largest Contentful Paint (LCP) and overall Core Web Vitals scores. Faster pages lead to lower bounce rates, longer dwell time, and better user engagement — all signals that support higher rankings.
Google has supported AVIF in its image search index since 2020, and all major browsers now support the format. Serving AVIF where supported demonstrates technical excellence that aligns with modern image optimization best practices.
How to Implement AVIF
Use the <picture> element with AVIF as the primary source and WebP or JPEG as fallbacks for older browsers. Most modern image CDNs and build tools can automatically generate AVIF variants. Configure your server to include proper Content-Type: image/avif headers and enable content negotiation via the Accept header so browsers receive the optimal format automatically.
For static sites, integrate AVIF generation into your build pipeline using tools like Sharp or Squoosh. For dynamic sites, use an image CDN that handles format negotiation at the edge. Always set appropriate cache headers since AVIF files are immutable once generated.
Common Mistakes
- Not providing fallbacks: While browser support is broad, always include WebP and JPEG fallbacks in a
<picture>element to avoid broken images on older browsers. - Over-compressing AVIF images: AVIF is efficient at low quality settings, but pushing compression too far creates visible artifacts, especially on text-heavy images and sharp edges.
- Ignoring encoding time: AVIF encoding is significantly slower than JPEG or WebP. Generate images at build time or via CDN rather than on-the-fly for each request.
- Using AVIF for all image types: AVIF excels at photographs and complex images but may not outperform PNG for simple graphics, icons, or images with very few colors.
- Forgetting to update Content-Type headers: Serving AVIF with incorrect MIME types causes browsers to fail silently or fall back to re-downloading in another format.
AVIF represents the current state of the art in web image compression and is a key tool for achieving top Core Web Vitals scores.