AVIF to Base64 Converter - Encode AVIF Images to Base64 Online
Turn an AVIF image into a Base64 string for data URIs, CSS backgrounds or JSON. The file is read in your browser and nothing is uploaded.
Loading Image to Base64 Converter...
How to Convert AVIF to Base64 - Step by Step Guide
Upload Your AVIF Image
Start with your AVIF image file. Click the "Upload" button or drag the file onto the left panel. AVIF compresses well, which keeps the Base64 string shorter than it would be for the same picture as a PNG or JPEG.
Check the Preview and the Output
As soon as the file is read you get a Base64 encoded string on the right and a preview of the image on the left, with its file size and the format detected from the file itself.
Understanding Base64 Encoding
When your AVIF is converted to Base64:
Copy or Download Your Base64 String
Click "Copy" to put the Base64 string on your clipboard, or "Download" to save it as a text file. Both give you exactly what is shown in the editor.
<img src="data:image/avif;base64,..."> tagsWhat is AVIF to Base64 Conversion?
AVIF to Base64 conversion is the process of encoding an AVIF (AV1 Image File Format) image file into a Base64 text string. AVIF is a modern image format based on the AV1 video codec. It usually compresses better than JPEG and PNG, and supports HDR, wide color gamut, and transparency.
The Base64 encoding scheme transforms binary AVIF data into ASCII text using a set of 64 characters (A-Z, a-z, 0-9, +, /), making it possible to embed AVIF images directly in text-based formats like HTML, CSS, and JSON. This page does the conversion locally in your browser using the FileReader API, so the image is never sent to a server.
How AVIF to Base64 Encoding Works
When you convert an AVIF image to Base64, the binary data of the image file is read and transformed into a text representation. The browser's FileReader API reads the file as a data URL, and the tool keeps only the Base64 part after the comma.
The resulting Base64 string can be used directly in HTML <img> tags as a data URI, or in CSS background-image properties. Because AVIF files tend to be small, they are a reasonable fit for inlining.
Base64 encoding increases the size by about 33%. The encoded string is plain text, so it works anywhere text does, including JSON APIs, XML documents, and MIME email.
Frequently Asked Questions
How do I convert an AVIF image to Base64?
Click Upload and pick your .avif file, or drag it onto the left panel. The Base64 string shows up on the right as soon as the file is read, and you can copy it or download it as a .txt file. To go the other way, paste the string into Base64 to AVIF or Base64 to Image.
Is the Base64 exactly the same file, or is the image re-encoded?
It is the same file. The tool reads the raw bytes of your AVIF and encodes them as they are, so decoding the string gives you back a byte-for-byte copy. Nothing is resized, recompressed or converted, which also means HDR data, colour profiles and transparency stay in the file.
Is my AVIF image uploaded anywhere?
No. The file is read by your browser with the FileReader API and the Base64 is built on your own machine. Nothing is sent to our server and nothing is kept, so reloading the page starts empty again.
Does the tool include the data URI prefix?
No, you get the plain Base64 string. For HTML or CSS, put data:image/avif;base64, in front of it, for example <img src="data:image/avif;base64,YOUR_STRING">. If the file turns out to be a different format than its name suggests (a PNG renamed to .avif, say), the tool tells you and shows which prefix to use instead.
What happens if I pick a file that is not really an AVIF?
The tool checks the first bytes of the file, not just its name. A real image in another format is still encoded and labelled with its true type, with a note about the right data URI prefix. A text file, PDF or archive renamed to .avif is refused with a short explanation, and an empty file is reported as empty.
How big can the AVIF file be?
Up to 10 MB. Keep in mind that Base64 is about a third larger than the file itself, so a 3 MB AVIF becomes roughly 4 MB of text. For anything that large, a normal image URL is usually a better choice than inlining it.
Which browsers can display a Base64 AVIF?
Chrome 85+, Firefox 93+, Opera 71+ and Safari 16.4+ all show AVIF. If you need to support older browsers, wrap the image in a <picture> element and add a WebP or JPEG fallback.
How do I use the Base64 AVIF in CSS?
Use it inside url(), like background-image: url(data:image/avif;base64,YOUR_STRING);. Small icons and placeholders work well this way; big photos make your stylesheet heavy and can no longer be cached separately.
Need to turn a string back into a picture? Try Base64 to AVIF or Base64 to Image. For files that aren't images, use File to Base64.
Related Tools
Image to Base64
Convert images to Base64 encoded strings for embedding in HTML, CSS, and APIs
Base64 to Image
Decode Base64 encoded strings to view and download images (PNG, JPG, GIF, SVG)
PNG to Base64
Convert PNG images to Base64 encoded strings for embedding
Base64 to PNG
Decode Base64 strings to PNG images, see the picture and save the exact file
BMP to Base64
Convert BMP/Bitmap images to Base64 encoded strings
Base64 to BMP
Decode Base64 strings to BMP/Bitmap images