Base64 to Image / Image to Base64
Turn an image file into a Base64 data URL, or paste a Base64 string and see the image it contains — both directions run entirely in your browser.
Runs locally in your browser. Nothing is uploaded.
What is Base64 image conversion?
Images are binary files, but many places only accept text: HTML documents, CSS files, JSON payloads, and email bodies. Base64 bridges that gap by encoding the image’s bytes as plain text characters, prefixed with a data URL header such as data:image/png;base64, that tells the browser what kind of image follows. The result can be pasted directly into an img tag’s src attribute or a CSS background, and the image renders without any separate file or download. This is ideal for small icons, logos, and signature graphics that you want embedded in a single self-contained document.
The reverse direction is equally common in development: an API returns a long Base64 string, or you find one buried in source code, and you want to know what picture it actually is. Pasting it here renders a preview and offers a download, so you can inspect the image or save it back as a normal file. One trade-off to keep in mind: Base64 inflates data by about a third, so it suits small graphics, not full-size photographs — embedding a multi-megabyte photo as text makes documents heavy and slow to load.
How to use the Base64 image converter
To convert an image to Base64, choose a file with the file picker. The full data URL appears in the output box, and you can copy either the complete version (with the data: prefix, ready for HTML or CSS) or the raw Base64 string alone (for API parameters). The info line shows the original file size and the length of the generated text, with a warning if the output grows past one megabyte. To go the other way, paste a data URL or a raw Base64 string into the second box. If you paste a data URL, its format is detected automatically; for raw Base64, pick the image format from the dropdown first, then click Show image. A preview appears below, along with a download link that saves the restored image to your device.
Frequently asked questions
Why is the Base64 output bigger than the original image?
Base64 packs 3 bytes into 4 characters, so the text is always about 33% larger than the binary data, plus the data: prefix. That is inherent to the encoding, not a flaw in this tool.
Why did restoring fail?
Most often the string was truncated during copying, stray text got mixed in, or the wrong format was chosen for raw Base64. A data URL string is the most reliable input because it carries its own format.
Can SVG images be converted?
Yes. Choose SVG as the format when restoring a raw Base64 vector image, and an SVG file picked in direction one is encoded as text, producing a usable data URL.
Is it safe to paste images here?
Yes. File reading and decoding happen entirely in your browser via the FileReader API. Nothing is uploaded to any server, and nothing is stored after you leave the page.
Related tools
Base64 Encode / Decode · URL Encode / Decode · Hash Generator · Word Counter