# .avif MIME Type: image/avif

> AV1-based images — usually smaller than WebP, supported by all current major browsers.

- MIME type: `image/avif`
- Extensions: .avif
- Content-Type header: `image/avif`
- Compress in transit: no (already compressed)
- File signature: `66 74 79 70` at offset 4 (an ISO base media file; the brand after ftyp is typically avif)

## Good to know

- Encoding is slow compared with JPEG and WebP; generate AVIF at build time or cache it.
- Use `<picture>` with a WebP or JPEG fallback for older browsers.

## Server configuration

### nginx (inside the types block in mime.types)

```
image/avif avif;
```

### Apache (.htaccess or server config)

```
AddType image/avif .avif
```

### Express

```
res.set("Content-Type", "image/avif");
```

### Python

```
import mimetypes

mimetypes.add_type("image/avif", ".avif")
```

### HTML file input

```
<input type="file" accept=".avif,image/avif">
```

## FAQ

### What is the MIME type for .avif files?

`image/avif`.

### What Content-Type header should a .avif file be served with?

`Content-Type: image/avif`. It's already compressed, so servers shouldn't gzip it.

### How can I tell if a file is really a .avif?

Check its bytes rather than the extension: AVIF files contain `66 74 79 70` (`ftyp`) at byte offset 4 — an ISO base media file; the brand after ftyp is typically avif. On the command line, `file --mime-type name.avif` does this for you.

## Related types

- [.webp — image/webp](https://www.devkult.com/mime/webp.md)
- [.jpg — image/jpeg](https://www.devkult.com/mime/jpg.md)
- [.heic — image/heic](https://www.devkult.com/mime/heic.md)

Open the interactive page: https://www.devkult.com/mime/avif