About the Base64 to Image
Convert Base64 back into a picture you can see and save. Paste a full data URI (data:image/png;base64,...) or just the raw Base64 characters copied from code, an API response, an email source or a database, and the decoder shows the picture with its width, height, format and size.
Then save it as a PNG, JPG or WebP file, with a quality slider for JPG and WebP. Your browser decodes the string on your device and never uploads it, which matters when it holds a screenshot, a signature or an ID photo.
How it works
Base64 writes binary data using 64 safe text characters, so every 3 bytes of the image become 4 characters. Decoding reverses that. If you paste a data URI, the browser already knows the type from its prefix. If you paste raw Base64, the tool recognises the format from the first characters, which are always the same for each type: /9j/ is JPEG, R0lGOD is GIF, UklGR is WebP and PHN2Zy is an SVG that starts with <svg. Anything else, including PNG (which starts iVBORw0KGgo), is given the PNG type.
The preview and the details appear once the image loads. Downloading draws the decoded image onto a canvas at its full size and exports it in the format you pick, so you can, for example, turn a Base64 PNG into a smaller JPG. The size shown is an estimate from the length of the string:
decoded size (bytes) ≈ Base64 characters × 3 ÷ 4 string length = 4 × ceil(bytes ÷ 3) (about 33% longer than the file)
The estimate can be one or two bytes high because of the = padding at the end, and it ignores the data:image/...;base64, prefix.
Assumptions and limits
- Only images decode. A data URI must start with data:image/; a PDF or other file in Base64 shows an error.
- Saving always re-encodes the picture through a canvas. PNG keeps every pixel; JPG and WebP use the quality slider (10-100%, 85% by default). Hidden metadata such as EXIF isn't carried over.
- JPG has no alpha channel: a see-through background in the decoded picture comes out black in the JPG file. Save as PNG or WebP to keep it see-through.
- An animated GIF saves as its first frame only, and an SVG is saved as a flat picture at the width and height it declares.
- Raw SVG that begins with an XML declaration (Base64 starting PD94bWw) isn't detected; add data:image/svg+xml;base64, in front of it.
Worked examples
Checking an image inside a JSON API response
An API returns "avatar": "iVBORw0KGgoAAAANSUhEUgAA..." without a prefix. Paste just the value between the quotes: with no prefix the tool treats it as PNG, shows the preview with its dimensions (say 256 × 256 PX), and the estimated size tells you whether the API is sending a far bigger image than it needs to.
Turning an embedded email logo into a JPG
HTML emails often embed logos as data URIs. Copy everything from data:image/png;base64, to the closing quote, paste it, pick JPG at 85% and download decoded_base64_image.jpg. If the logo has a transparent background, choose PNG instead so it doesn't turn black.
How long the string is for a given photo
A 60 KB (61,440-byte) JPEG becomes 81,920 Base64 characters, so pasting an 80,000-character string should give you a picture of roughly that size.
61,440 ÷ 3 = 20,480 groups × 4 = 81,920 characters 81,920 × 3 ÷ 4 = 61,440 bytes ≈ 60 KB
Image size and Base64 length
Left: how long the string gets for a file of a given size. Right: roughly how big the file is for a string of a given length. The data:image prefix isn't counted.
| Image file size | Becomes (characters) | String length (characters) | Decodes to |
|---|---|---|---|
| 1 KB (1,024 bytes) | 1,368 | 1,000 | about 750 bytes |
| 10 KB | 13,656 | 10,000 | about 7.3 KB |
| 50 KB | 68,268 | 50,000 | about 36.6 KB |
| 100 KB | 136,536 | 100,000 | about 73.2 KB |
| 500 KB | 682,668 | 500,000 | about 366 KB |
| 1 MB (1,048,576 bytes) | 1,398,104 | 1,000,000 | about 732 KB |
How to use the Base64 to Image
- Paste the Base64 string. A full data:image/... URI or the raw characters; the preview and details appear as soon as it decodes.
- Choose the download format. PNG, JPEG or WebP, and set the output quality for JPEG and WebP.
- Download the image. Press Download Decoded Image to save it, or Reset to decode another string.
Frequently asked questions
How do I convert a Base64 string to an image?
Paste the string into the box; if it decodes, the picture appears on the right with its dimensions and format. Pick PNG, JPEG or WebP and press Download Decoded Image to save it as a normal file you can open, edit or upload anywhere.
Do I need the data:image/png;base64, part?
No. Raw Base64 works too: the tool reads the first characters to recognise JPEG, GIF, WebP and SVG, treats anything else as PNG, and adds the prefix itself. Keep the prefix if you have it, because it states the type exactly and also helps with formats the tool doesn't detect.
Why does it say the Base64 string is invalid?
Usually because the string was cut short when copying, has extra text such as quotes or a JSON key attached, or isn't an image at all. Copy only the value, check that nothing is missing from the end (it often ends in = or ==) and that a data URI says image/ after data:.
Can I decode a data URI from CSS or HTML?
Yes. Copy the text inside url(...) in CSS or inside src="..." in an img tag, without the quotes or brackets, and paste it. A lot of inline icons, background images and email logos are stored this way.
Why is the Base64 text bigger than the image?
Because Base64 uses 4 characters for every 3 bytes, the text is about a third larger than the file it encodes: a 100 KB image is about 136,500 characters. That overhead is why large images are better linked as files than embedded as Base64.
Is the Base64 string sent to a server?
No. Decoding and saving happen in your browser, so the image never leaves your device. You can safely paste strings taken from private systems, such as scanned documents, signatures or user photos stored in a database.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.