Base64 to Image
Paste Base64 or a data URI. See the image and save it. Nothing leaves your browser.
- 0
- Characters
- 0
- Bytes
- 0
- Errors
On this page
About Base64 to Image
Updated
What is a Base64 to image converter?
It turns Base64 text back into the picture it holds. APIs, JSON files, emails and web pages often carry small images as Base64 or as a data URI. This tool shows the image, names its type, gives its size in pixels, and saves it as a normal file.
How to use this tool
Paste the Base64 or the data URI. The File view shows the image as you type. Press Download to save it. Summary lists the type, the size in bytes and pixels, and what the tool found in the text. Hex shows the bytes, which helps when an image does not show.
To go the other way, use Image to Base64. For Base64 that holds text, a certificate or another file, use Base64 Decode.
Common problems
The Base64 is cut short
A copy that stopped early still decodes, but the picture is not whole and the browser cannot show it. Copy the whole value again, up to the last character.
A character that is not Base64
A bad copy can leave a character that Base64 does not use. The tool rings it and names its line and column.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABg!AAAAYCAIAAABRemove the character, or copy the value again.
A data URI with the wrong type
A data URI that says image/png can hold a JPEG. Browsers show it anyway. The tool names the real type from the bytes, and Download uses the right extension.
Other Base64 resources
- RFC 4648: Base16, Base32 and Base64The standard for Base64 and Base64URL, with the alphabets, the padding rules and test vectors.
- MDN: Base64Base64 in the browser: atob(), btoa() and the problem with Unicode text.
- MDN: Uint8Array.fromBase64()The newer JavaScript way to decode Base64 and Base64URL to bytes.
- MDN: data: URLsHow to put a file inside HTML or CSS as data:type;base64,...
- RFC 2045: Base64 in email (MIME)Where the 76-character lines in email come from.
- RFC 7468: PEM text encodingsThe BEGIN and END lines around certificates and keys, and the Base64 between them.
- Wikipedia: Base64History, variants and a worked example of the encoding, bit by bit.
Base64 to Image FAQ
How do I convert Base64 to an image?
Paste the Base64 in the editor. The File view shows the picture, its type and its size in pixels. Press Download to save it as a file. The tool picks the extension from the bytes, so a PNG saves as .png and a JPEG as .jpg.
Can I paste a whole data URI?
Yes. A value such as data:image/png;base64,iVBORw0... is read as it is: the tool skips the part up to the comma. It also reads Base64URL, Base64 without = at the end, and Base64 with line breaks.
How does the tool know the image type?
From the first bytes of the image. Every format starts with its own signature: a PNG starts with the bytes 89 50 4E 47, a JPEG with FF D8 FF, a GIF with GIF8. The type in a data URI is only a label and can be wrong, so the tool trusts the bytes.
Why does the image not show?
The Base64 is often cut short, for example by a copy that stopped early or a log that cut a long line. The bytes still decode, but the picture is not whole. Copy the whole value again. If the File view says the bytes are not an image, the Base64 holds another kind of file: the File view names it.
Is it safe to open an SVG from Base64?
Here, yes. An SVG can hold a script. The preview shows the SVG as an image, where scripts never run, and Download saves it as a plain file. Do not open an SVG from an unknown source directly in a browser tab.
Is my image sent to a server?
No. The Base64 is decoded and shown in your browser. Nothing is uploaded, and nothing is put in the URL.