How to use it
A Base64 to image converter turns a picture stored as text, in an API response, a log entry or a database column, back into a file you can open. Paste a data URI or a raw Base64 string: the tool identifies the type from the byte signature, shows a preview with pixel dimensions and file size, and lets you download it with the correct extension. Decoding happens in your browser.
How to convert Base64 to image
- Paste the Base64 text, or a data URI starting with
data:image/…;base64,, into the input field. - Do not bother cleaning up line breaks and spaces; they are ignored, and URL-safe (base64url) strings are accepted too.
- Look at the preview and the details below it: detected type, width × height and file size.
- Download the image; it is saved with an extension that matches its type, such as
image.pngorimage.jpg. - If you get an error message, work through the debugging list below.
How the image type is detected
The tool decides the type from the signature at the start of the decoded bytes, not from the data URI header or the file name you expect. PNG, JPG, GIF, WebP, BMP, ICO and AVIF are recognized this way; if the decoded text begins with an <svg tag, the data is treated as SVG. You can often make a rough guess yourself from the first characters of the string:
| String starts with | Likely content |
|---|---|
iVBORw0KGgo | PNG |
/9j/ | JPG (JPEG) |
R0lGOD | GIF |
UklGR | RIFF container; WebP for images |
Qk | BMP |
AAABAA | ICO |
PHN2Zy | SVG (text starting with <svg) |
JVBERi0 | PDF; not an image |
The table is for a quick visual check; the tool always decides by inspecting the decoded bytes. AVIF files do not share one fixed prefix because their first box size varies, but the tool detects them as well.
When the data URI declares the wrong type
Some services return every image with a data:image/png header even when the content is JPEG. Browsers usually tolerate the mismatch silently, but save the file with the wrong extension and certain programs refuse to open it. Here, when the header and the content disagree, the content wins: if the bytes are JPEG, the download arrives as .jpg. If you see this mismatch in your own API, it is a good moment to review the MIME type setting on the server side.
Debugging: the usual suspects
- Invalid Base64 error and JSON escaping: some JSON encoders escape forward slashes as
\/. Backslashes are not part of the Base64 alphabet. Copy the value from the parsed field rather than the raw JSON text, or open the payload in the JSON formatter and take the right field from there. Leftover quotation marks at either end cause the same error. - Truncated log entries: logging systems often cut long values at a fixed length and append an ellipsis or a marker. Such a string is either rejected or produces an image with a missing part. Take the full value from the network response or the database.
- Valid Base64, but not an image: the string is valid Base64 but does not contain a picture. Starting with
JVBERi0means PDF,UEsDBmeans ZIP or an Office document; to check whether it is plain text, decode it with the Base64 encoder and decoder. - Double-encoded data: a string beginning with
aVZCTis very likely the Base64 of a PNG encoded a second time. Decode it once with the text decoder and paste the resultingiVBOR…string here.
SVG previews and safety
An SVG is a document as much as a picture, and it can contain scripts. The tool shows SVGs inside an image element, so no script runs during the preview. Before opening a downloaded SVG file directly in a browser, though, make sure you trust its source, especially when the data came from user uploads.
After decoding
If the image turns out to be WebP or AVIF and will not open in some program, a converter such as WebP to JPG moves it to a format that opens everywhere. Going the other way, when you need to turn a picture into text for test data or an API request, use the image to Base64 converter. For the background on the encoding itself, read what Base64 is.
Where your data is processed
The text you paste is decoded by JavaScript running in your browser; it is not transmitted to our server, and the page only increments an anonymous usage counter. That detail matters when you are inspecting sensitive values from a live system, such as users' ID photos or signature images.