.avif MIME type
AVIF imageimages
image/avifAV1-based images — usually smaller than WebP, supported by all current major browsers.
| MIME type | image/avif |
|---|---|
| Extensions | .avif |
| Content-Type | image/avif |
| Compress in transit? | No — already compressed |
| File signature | 66 74 79 70 (ftyp) 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.
Serve .avif files with the right type
The response header to send:
Content-Type: image/avif
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
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">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.avif | grep -i '^content-type:' file --mime-type file.avif
Frequently asked questions
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
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options