AVIF (AV1 Image File Format)
Royalty-free HDR & wide-gamut next-gen web image format wrapping AV1 keyframes inside an ISO Base Media (`ftyp`) container (`major_brand` = `avif` or `avis`).
Shares the ISOBMFF box container with HEIC and MP4; requires reading offset `0x08` (`avif` for still images, `avis` for animated image sequences).
Drop any .avif file (even 100 GB+) to inspect locally
Reads tiny File.slice() header/footer pages in a sandboxed Web Worker · 0 Bytes Uploaded
.avif Magic Bytes & Header Offset Map
ISOBMFF ftyp box with 'avif' or 'avis' brand prefix
| Byte Offset | Length | Data Type | Field Name | Engineering Description |
|---|---|---|---|---|
| 0x00 - 0x03 | 4 B | uint32_be | ftyp_size | Box byte length |
| 0x04 - 0x07 | 4 B | char[4] | box_type | 'ftyp' FourCC |
| 0x08 - 0x0B | 4 B | char[4] | major_brand | 'avif' (still) or 'avis' (sequence) |
.avif Security & Polyglot Risk Matrix
Inspect `ispe` box dimensions before full pixel decoding to block decompression bombs (e.g. 65000x65000px 10KB solid-color AV1 frames).
Read .avif Header & Metadata Without Heavy Dependencies
import struct, sys
with open(sys.argv[1], "rb") as f:
sz, box, brand = struct.unpack(">I4s4s", f.read(12))
assert box == b"ftyp" and brand in (b"avif", b"avis")
print(f"AVIF brand={brand.decode()}")Deterministic .avif Sample Files & Edge Cases
minimal-128x128.avif
Real AVIF encoded by libavif via pillow-avif: ftyp avif, decodable AV1 primary item.
curl -fsSL https://fileformat.co/fixtures/v1/avif/minimal-128x128.avif -o minimal-128x128.avif \
&& echo "c1d62b9cfb1ac1ef878cabf2033ef0bd25067ff3fcc032aa0dc5c2c833687918 minimal-128x128.avif" | shasum -a 256 -cphoto-640x480.avif
Real AV1 Image File Format still encoded by libavif at 640×480.
curl -fsSL https://fileformat.co/fixtures/v1/avif/photo-640x480.avif -o photo-640x480.avif \
&& echo "66e43e004db1ebc43bcf2b7e3f44198d43d83ec0d828b064a69e5ffa1254667e photo-640x480.avif" | shasum -a 256 -ctruncated-box.avif
Real AVIF truncated inside the mdat payload — libavif decoder must raise.
curl -fsSL https://fileformat.co/fixtures/v1/avif/truncated-box.avif -o truncated-box.avif \
&& echo "8fc0516c40d536a757998b236c6d6d96a4b5a36874d8b17c72a64829251e0ae4 truncated-box.avif" | shasum -a 256 -cRelated Specifications & Alternatives
Apple iOS default camera photo container encapsulating HEVC (H.265) intra-coded image tiles, depth maps, and EXIF metadata inside an ISO Base Media (`ftyp`) box hierarchy.
RIFF-based modern raster image container supporting lossy (`VP8 `), lossless (`VP8L`), and extended alpha/animated/EXIF (`VP8X`) bitstreams.
Lossless CRC-checked chunked raster image format, heavily used in AI workflows (ComfyUI / Stable Diffusion) to store generation graphs and prompts inside `tEXt`/`iTXt` chunks.