Convert AVIF images to Base64-encoded data URIs — the format used to embed images directly in HTML, CSS, and JavaScript. Upload one or more .avif files and get the full data:image/avif;base64,... string for each, ready to copy with one click. Nothing is uploaded.
Drag and drop .avif files here, or click to browse
Select one or multiple files
.avif files.A Base64 data URI is a text-encoded representation of a binary file. For images it looks like this:
data:image/avif;base64,AAAAHGZ0eXBhdmlmAAACA...
The entire image is embedded in the string, so you can include it anywhere text is accepted — no separate file request needed.
HTML <img> tag:
<img src="data:image/avif;base64,AAAA..." alt="My image">
CSS background:
.hero {
background-image: url("data:image/avif;base64,AAAA...");
}
JSON data:
{ "thumbnail": "data:image/avif;base64,AAAA..." }
Email HTML: Embed images directly in an HTML email to avoid external image blocking.
Base64 encoding increases file size by approximately 33%. For most web pages, using a separate image file is more efficient because the browser can cache it. Base64 makes sense for:
How much larger is a Base64 string compared to the original file?
Base64 encoding increases size by roughly 33%. A 100 KB AVIF becomes approximately 133 KB as a Base64 string.
Can I paste this directly into an <img src="..."> attribute?
Yes. The output string starting with data:image/avif;base64, is a valid value for the src attribute of any HTML <img> tag in browsers that support AVIF.
Are my files uploaded anywhere?
No. The conversion is done by FileReader.readAsDataURL() in your browser. Nothing is sent to a server.
This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.