# WebP to AVIF Conversion

To convert WebP to AVIF, run `npx optimo image.webp --format avif`. AVIF can be smaller than WebP for photo-heavy content. Optimo handles format conversion and optimization in a single step.

## Command

Convert a file by targeting the output format:

```
npx optimo image.webp --format avif
```

Tip: add `--dry-run` to preview changes.

## Why convert?

- AVIF can be smaller than WebP for photo-heavy content.
- Useful when chasing aggressive performance budgets.

## Format notes

### WebP

Modern image format with great compression and broad browser support.

[Optimize WebP](/content/optimize/webp/index.html) [Compress WebP](/content/compress/webp/index.html) [Resize WebP](/content/resize/webp/index.html) [WebP guide](/content/formats/webp/index.html)

### AVIF

High-compression modern image format that can beat WebP on size at similar quality.

[Optimize AVIF](/content/optimize/avif/index.html) [Compress AVIF](/content/compress/avif/index.html) [Resize AVIF](/content/resize/avif/index.html) [AVIF guide](/content/formats/avif/index.html)

## Not sure which to use?

If you're choosing a delivery format, here's a quick comparison.

[WebP vs AVIF](/content/compare/webp-vs-avif/index.html)
