How to use
- Drop an .avif file onto the drop area, click to choose one, or paste an image.
- Keep the original format. AVIF is usually the smallest option, and the tool cannot re-encode images to AVIF.
- Convert to PNG, JPEG or WebP only if the receiving side cannot handle AVIF.
- Copy the data URI for the source of a picture element, or use the raw Base64, img tag, CSS or Markdown output.
What is AVIF?
AVIF (AV1 Image File Format) stores images compressed with the AV1 video codec inside a HEIF container. It was published by the Alliance for Open Media in 2019 and supports transparency, animation, 10 and 12-bit colour, HDR and wide colour gamuts. The MIME type is image/avif.
At the same visual quality, AVIF files are often clearly smaller than JPEG and usually smaller than WebP, especially at low bit rates. Since Base64 adds the same third to any file, a smaller AVIF directly means a shorter data URI.
Browser support and fallbacks
AVIF displays in Chrome 85 and later, Firefox 93 and later, Safari 16 and later, and Edge 121 and later. Older browsers and most email clients cannot show it. On the web, wrap the data URI in a <picture> element with a fallback:
<picture>
<source type="image/avif" srcset="data:image/avif;base64,...">
<img src="logo.png" alt="Logo" width="120" height="40">
</picture>
Keep the fallback as a separate file. If it were a data URI as well, every visitor would download both versions as part of the HTML.
Encoding and conversion options
The tool encodes your AVIF file exactly as it is. AVIF is not among the conversion targets, which are PNG, JPEG and WebP, so to create AVIF from another format use a dedicated encoder such as avifenc, Squoosh or an image editor, then encode the result here.
Converting an AVIF to PNG, JPEG or WebP works in browsers that can decode AVIF and is useful for systems that do not accept it, but the result is usually larger. If you need broad support and a small size, WebP is the closest alternative.
Frequently asked questions
Can I convert PNG or JPEG to AVIF here?
No. The conversion targets are PNG, JPEG and WebP. Create the AVIF file with another tool first, then drop it here to encode it.
Which browsers show data:image/avif images?
Chrome 85+, Firefox 93+, Safari 16+ and Edge 121+. For older browsers, provide a PNG or JPEG fallback in a picture element.
Why is there no preview of my AVIF image?
Your browser probably cannot decode AVIF. The Base64 output is still produced from the file bytes and is correct; open the page in a current browser to see the preview.
Is AVIF Base64 shorter than WebP Base64?
Usually, at a similar visual quality. Base64 adds the same 33% to both formats, so the smaller source file always gives the shorter string.