Bài viết này hiện chỉ có bằng tiếng Anh.

AVIFMar 6, 20266 min read

AVIF Is Smaller, So Why Still Use WebP?

AVIF can produce excellent compression. On some images, it can be meaningfully smaller than WebP at a similar perceived quality. That does not make WebP obsolete for every site. Format decisions are not based on one benchmark. They also depend on browser support, encoding speed, visual review, tooling, fallback strategy, and operational simplicity.

Many practical workflows use both: AVIF where it performs well and WebP as a broadly useful modern format.

"AVIF is always better" and "WebP is outdated" are winner-takes-all headlines, not format decisions. A defensible decision names the asset category, the delivery surface, the fallback behavior, and the date the support assumptions were reviewed.

Smaller Is Not the Only Metric#

File size matters, but it is not the only approval criterion. A format decision should consider:

  • visual quality at the target size
  • encoding time
  • decoding behavior on target devices
  • browser and embedded-view support
  • CMS and CDN compatibility
  • fallback complexity
  • team familiarity
  • ability to regenerate assets later

A 12 percent smaller file is useful if it fits the workflow. It may be less useful if it creates slow build steps, difficult debugging, or inconsistent delivery.

AVIF Can Be Excellent for Photos#

AVIF is often strong for photographic content, especially where quality can be tuned carefully. It may produce smaller outputs for hero photos, editorial images, and some product images.

MDN's image file type guide is a useful reference for understanding common browser image formats and use cases. The practical lesson is that image type should follow the asset, not a universal rule.

If AVIF looks good, is supported by the delivery system, and does not slow operations unreasonably, it may be a strong first source in a picture element.

WebP Remains Operationally Useful#

WebP has broad tooling support and a long history in production image pipelines. Google's WebP documentation covers lossy, lossless, and alpha support. For many teams, WebP is easy to generate, inspect, cache, and integrate with existing workflows.

WebP is often a good fit for:

  • broad modern-browser delivery
  • fast local conversion workflows
  • WordPress and CMS migrations
  • transparent images that need careful review
  • build systems that need predictable speed
  • teams that want a simpler fallback ladder

This does not mean WebP wins every size comparison. It means it can be easier to operate well.

For GetWebP workflows, the relevant product facts are documented in the CLI command reference: the CLI can write WebP or AVIF outputs, originals are not modified or deleted, and --format accepts webp or avif. That matters because a team can compare both outputs from the same source set without risking the canonical originals.

Encoding Time Can Matter#

If a team converts a few images manually, encoding speed may not matter much. If a build converts thousands of images in CI, local development, or a CMS upload pipeline, speed and reliability become important.

AVIF encoding can be slower depending on settings and tooling. That may be acceptable for final production builds but frustrating for rapid editorial workflows. WebP may be chosen for faster iteration even when AVIF wins some file-size comparisons.

Measure the workflow, not only the output bytes.

This is especially relevant for teams that regenerate images often. A documentation site with daily screenshots, a store with frequent product uploads, or an agency managing many client sites may prefer a format mix that keeps publishing predictable. The smaller file is not always the better operational default if it slows every routine update.

Run a Small Format Trial First#

Before changing a site-wide image policy, choose a small sample that represents the real library:

sample/
  hero-photos/
  product-zooms/
  screenshots/
  transparent-ui/
  thumbnails/

Then produce separate outputs so the review does not overwrite source files or mix formats in one folder:

npx -y getwebp ./sample --format webp --output ./trial/webp --recursive --json
npx -y getwebp ./sample --format avif --quality 55 --output ./trial/avif --recursive --json

The --json output is NDJSON, not one large JSON array. For each successful file, record outputPath, originalSize, newSize, saved, quality, and qualityMode. Do not treat the numeric quality values as equivalent across formats; use them as settings to document, then inspect the rendered output.

A useful review note looks like this:

Last reviewed: 2026-03-06
Source sample: 42 images from product, editorial, screenshot, and logo folders
WebP path: ./trial/webp
AVIF path: ./trial/avif
Decision: AVIF first for editorial hero photos; WebP default for screenshots and fast editorial uploads
Reason: AVIF saved more bytes on photos, but screenshots required closer text review and WebP kept the publishing path simpler
Fallback: original JPEG/PNG retained and delivered through picture markup where AVIF is enabled
Next review: repeat when CDN, CMS, or browser-support requirements change

This kind of dated note is stronger than a generic benchmark claim because another teammate can rerun it with the same categories.

Use a Fallback Ladder Deliberately#

A common delivery pattern is:

<picture>
  <source srcset="/images/hero.avif" type="image/avif" />
  <source srcset="/images/hero.webp" type="image/webp" />
  <img src="/images/hero.jpg" alt="Product detail view" />
</picture>

This gives capable browsers AVIF, uses WebP as a strong fallback, and preserves a classic fallback. It also creates more files to generate, store, purge, and review.

If the site is small, this may be easy. If the site has thousands of assets, the maintenance cost should be considered.

For WordPress delivery, the same operational question appears in plugin settings. GetWebP's frontend delivery documentation explains the picture-tag path that can serve AVIF first, WebP second, and the original image as fallback. That is safer than rewriting every image URL to one newer format when the site has older embedded views, email previews, or third-party caches in the path.

Test Difficult Images#

AVIF and WebP can fail differently. Test real images from your site:

  • screenshots with text
  • transparent graphics
  • gradients
  • dark photos
  • product close-ups
  • fine texture
  • animated or motion assets

Do not choose the format from a generic benchmark alone. The site's image library may behave differently.

Also test failure handling. A format strategy is not complete until someone has checked what happens when a converted sibling is missing, a cache keeps an old URL, or a visual regression is found after publishing. The security and privacy architecture is useful context for this review because it separates local image processing from control-plane traffic; it should not be stretched into a claim that every delivery environment is automatically private or cache-safe.

Decide by Asset Category#

A practical rule might be:

Hero photos: AVIF first, WebP fallback
Product zoom: compare AVIF and WebP manually
Screenshots: WebP or PNG depending on text clarity
Transparent logos: SVG, PNG, or lossless WebP
Thumbnails: WebP if workflow speed matters
Archive content: WebP only to reduce complexity

This gives the team room to use AVIF where it shines without forcing complexity everywhere.

AVIF being smaller in many cases is important. WebP still earns a place when it offers strong quality, broad workflow support, faster generation, simpler debugging, or a dependable fallback. The best format strategy is measured on real images and real delivery constraints.

Jack avatar

Jack

GetWebP Editor

Jack writes GetWebP guides about local-first image conversion, WebP workflows, browser compatibility, and practical performance checks for teams that publish images on the web.