Turn Base64 text back into a picture
Images are sometimes stored or sent as Base64 text: inside API responses, JSON files, database fields, HTML emails or CSS files. Looking at the long string tells you nothing about what the picture is. This decoder shows you the image straight away and lets you save it as a normal file.
How to decode Base64 to an image
- Paste your Base64 code into the box. It can be a full data URI starting with
data:image/or only the encoded part. - Click Show image. The tool checks the text, detects the format and shows a preview with the image size.
- Click Download to save the picture with the correct file extension.
How the format is detected
If you paste a data URI, the format is read from its MIME type. If you paste plain Base64, the tool looks at the first few characters, which come from the file's "magic number" (the signature bytes at the start of every image file):
| Base64 starts with | Format |
|---|---|
iVBORw0KGgo | PNG |
/9j/ | JPEG |
R0lGOD | GIF |
UklGR | WebP |
PHN2Zy or PD94bWw | SVG |
Common problems
- Extra characters: quotes,
url(or a trailing comma copied from code will break the string. Paste only the Base64 part. - Cut-off text: if the string was shortened in a log file, the picture cannot be rebuilt.
- URL-safe Base64: strings using
-and_instead of+and/are converted automatically.
Frequently asked questions
How large an image can I decode?
Several megabytes work fine in modern browsers. Very long strings may take a moment to paste.
Can I convert an image to Base64 instead?
Yes, use the Image to Base64 converter.
Is the decoded image stored anywhere?
No. Decoding and preview happen in your browser only.