Base64 ↔ image

Preview and download a Base64 image, or encode an image file as Base64.

Local processing · No upload · Up to 20 MiB per file

Loading local tool…

How to use Base64 ↔ image

Paste raw Base64 or an image data URI and select Convert. Alternatively, choose an image file to encode; the file takes precedence over pasted text. Use Clear to remove a selected file before decoding pasted data.

Reproducible example

Load example then Convert to preview a one-pixel PNG. Enable Include data URI to add the MIME prefix for use in an HTML image source. The downloadable image contains the decoded original bytes.

Limits and file handling

Base64 increases encoded size by roughly one third and is not encryption. PNG, JPG, GIF, WebP and AVIF are accepted; SVG and arbitrary files are rejected. Browser support determines whether an AVIF image can be previewed. Input is held in this page only and is not saved in browser storage. Clear removes inputs and outputs; navigating away does not transfer them to another tool.

Raw Base64 versus image data URIs

A data URI starts with a MIME type and a base64 marker, followed by the encoded bytes. This decoder inspects image signatures rather than trusting a supplied MIME label, and accepts whitespace and the URL-safe alphabet. Invalid padding and non-canonical trailing bits are rejected. The preview is an image element, never injected HTML. Image downloads preserve the decoded bytes, including any metadata in the original file. The displayed dimensions describe the decoded image and are not a promise that embedded metadata is safe to share.

Related tools

Image compressor · Image converter · JSON ↔ CSV · HEIC → JPG · Base64 → PDF · Base64 text · JSON formatter

Choose a developer tool

More tools for data, text and testing

Run the AES interoperability guide or read how these tools are checked.