Loading Base64 to Image Converter...

How to Convert Base64 to an AVIF Image

Step 1

Paste your Base64 string

Paste the Base64 text into the input box. A full data:image/avif;base64, URI works too, as does Base64 that is split over several lines or uses the URL-safe - and _ characters. You can also load it from a .txt or .base64 file.

•
Where it usually comes from: an <img src="data:image/avif;base64,..."> tag, a CSS background-image, a JSON field from an API, or a blob column in a database
•
Quotes and prefixes: you don't need to trim the data:image/avif;base64, part or the quotes around a JSON value
•
The Sample button: loads a small PNG so you can see how decoding works; for an AVIF, paste your own string
Step 2

Check what the bytes really are

The string is decoded as you paste it. The page reads the first bytes of the file and tells you what it is, so a PNG or JPEG pasted here is labelled as a PNG or JPEG, not as AVIF. A preview appears below; recent Chrome, Firefox, Edge and Safari can all draw AVIF.

How the page recognises an AVIF

An AVIF file starts with an ISO box called ftyp that names the brand avif (or avis for an animated one). In Base64 that start usually looks like AAAAIGZ0eXBhdmlm; the first few characters change with the box size, but GZ0eXBhdmlm stays. A PNG starts with iVBORw0KGgo and a JPEG with /9j/, which is how the page can tell you when a so-called AVIF is really something else.

Step 3

Download the file

Click Download. You get exactly the bytes that were encoded, saved with the extension that matches the real format, so an AVIF comes out as .avif. You can type your own file name first.

•
Use it anywhere: the saved .avif opens in current browsers, image viewers and editors that support AVIF
•
Next one: press Clear to empty the box and decode another string

What is Base64 to AVIF Conversion?

AVIF is an image format built on the AV1 video codec. Sites and image CDNs use it because it tends to give small files at a given quality, and it can carry transparency and HDR. When an AVIF has to travel inside text, for example in JSON, an HTML attribute or a CSS file, it gets written as Base64.

Decoding simply turns those characters back into the original bytes. The file you download is the one that was encoded, with nothing re-compressed or converted along the way. Base64 is about a third larger than the file it holds, so the download will be roughly three quarters the length of the text you pasted.

Frequently Asked Questions

How do I turn a Base64 string back into an AVIF file?

Paste the string into the box at the top of this page. If the bytes inside are an AVIF image, the panel on the right says AVIF and shows a preview, and the Download button saves it as a .avif file. If you need to go the other way, use the AVIF to Base64 encoder.

Is the downloaded AVIF exactly the same as the original?

Yes. Base64 is just another way of writing the same bytes, and this page never re-encodes the image. Whatever was in the original file, such as transparency, HDR data or a colour profile, is still there in the download because nothing was changed.

Can I paste a data URI from HTML, CSS or JSON?

Yes. A string like data:image/avif;base64,AAAAIGZ0eXBhdmlm... is fine; the prefix is removed before decoding. Line breaks inside the Base64 are ignored, and URL-safe Base64 without padding is accepted too.

Why does it say PNG or JPEG when I am on the AVIF page?

Because that is what the bytes are. The format is read from the start of the decoded file, not from the page you are on or the data: prefix. It is common for an API to label an image as AVIF when it actually sends something else. The download gets the matching extension, so the file opens properly.

What image does the Sample button load?

A small 32 by 32 PNG. It is there to show how the page works, so it is labelled PNG and downloads as .png. To try a real AVIF, paste your own Base64 or a data:image/avif URI.

Why is there no preview for my AVIF?

AVIF needs a fairly recent browser to display: Chrome 85, Firefox 93, Safari 16.4 or newer, or a current Edge. On an older browser the preview stays blank, but the decoded file is still complete and the Download button still saves it.

What happens if the Base64 is broken or is not an image?

If a character does not belong in Base64, the page tells you the line and column where it is. If the string is cut off, it says so. If it decodes fine but turns out to be text, a PDF or a ZIP file, you are told that too instead of getting a broken image.

Is my image uploaded anywhere?

No. Decoding happens in your browser with JavaScript, and nothing you paste is sent to our server or kept. Reload the page and the box starts empty.

Related: AVIF to Base64 encodes an image file, and Base64 to Image decodes the other common image formats.