AVIF to Base64
Encode next-gen AVIF images as Base64 data URIs.
Drag & drop a file here, or click to browse
Drop an AVIF file here. Max 10 MB, converted in your browser.
AVIF to Base64 Converter
Convert AVIF images to a Base64 string or a data:image/avif;base64,... URI in your browser. AVIF produces some of the smallest image files available today, which makes it an attractive format when you need to embed pictures directly in code.
What is AVIF?
AVIF (AV1 Image File Format) was finalized by the Alliance for Open Media in 2019. It stores images compressed with the royalty-free AV1 video codec inside a HEIF/ISOBMFF container — the same box structure used by MP4 files. Compared with older formats it offers:
- Roughly 50% smaller files than JPEG and 20–30% smaller than WebP at similar visual quality.
- Full alpha transparency, even in lossy mode.
- HDR, wide color gamut, and 10- or 12-bit color depth.
- Animated image sequences.
The trade-offs are slower encoding and, for a few more years, incomplete support in older browsers and many email clients.
Recognizing AVIF data
Because AVIF uses an ISO box container, the file starts with a size field and ftyp, followed by the brand avif (or avis for sequences). In Base64 the string usually begins with AAAAIGZ0eXBhdmlm or AAAAHGZ0eXBhdmlm: AAAA and the next character encode the box size, and Z0eXBhdmlm continues with ftypavif. This tool uses image/avif as MIME type even if your OS doesn't report one for .avif files.
When to inline an AVIF
AVIF shines for tiny, high-quality placeholders and hero thumbnails where every kilobyte matters — for example a 2 KB blurred preview embedded in server-rendered HTML. Since not every visitor can decode it, pair it with a fallback:
<picture><source type="image/avif" srcset="data:image/avif;base64,..."><img src="fallback.jpg" alt="..."></picture>
For a widely supported alternative with nearly the same benefits, use WebP to Base64. To decode and download an AVIF string, paste it into Base64 to Image.
Frequently Asked Questions
Which browsers can display an AVIF data URI?
Chrome and Opera since 2020, Firefox since version 93, Safari since 16.4 (macOS Ventura / iOS 16), and Edge since version 121. Older browsers will show a broken image, so provide a WebP or JPEG fallback with <picture> if you still support them.
Why does the preview stay empty for my AVIF file?
Your browser (or operating system) probably can't decode AVIF, or the file uses a feature like 12-bit depth that isn't supported yet. The Base64 output is still correct — it just can't be previewed here. Try opening the page in a current version of Chrome or Firefox.
What MIME type should an AVIF data URI use?
Use image/avif. Some operating systems don't report a type for .avif files, so this tool falls back to image/avif automatically. Animated AVIF image sequences also use image/avif in practice.