How to use Base64 to Image
- Paste the text into Data URI or Base64. The box starts with a small sample PNG so you can see how it works.
- The result appears as you type: the picture, its Size in pixels, its Format and the number of Bytes.
- Read any warning, such as a type mismatch.
- Download the image. The file is named image plus the real extension, for example image.png or image.gif.
What it does and when to use it
Images often travel as text: inside HTML and CSS as data URIs, in JSON from an API, in email source code, in database exports and in logs. This tool turns that text back into a picture you can see and save. Developers use it to check what an API actually returned, to recover an icon from a stylesheet, or to debug a broken inline image.
To go the other way, use Image to Base64. For Base64 that holds text or other files rather than pictures, use Base64 Decode. To learn more about the decoded file, such as bit depth and transparency, save it and open it in Image Info.
How it works
The tool trims the input and checks for a data: prefix. For a ;base64, URI, or bare Base64, it removes whitespace, maps URL-safe characters back to standard ones, restores padding and decodes the bytes. A plain data: URI without Base64, common for SVG, is URL-decoded instead. The first bytes of the result are matched against known image signatures to find the real format, and the header is read for the pixel size.
Worked examples
Outputs from the tool’s own function.
A tiny GIF. R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 decodes to a GIF of “Size: 1 × 1 px” and 42 B, the classic single-pixel image used in emails.
Text, not a picture. SGVsbG8gd29ybGQ= decodes fine but gives “Decoded 11 bytes, but they are not an image format we recognise”. Those 11 bytes are the words “Hello world”.
Not Base64 at all. not base64! contains an exclamation mark, which is not a Base64 character, so the answer is “This is not Base64 or a data: URI.”
A wrong label. The sample PNG pasted with the prefix data:image/jpeg;base64, still shows as a 24 × 24 px PNG, with a warning to use data:image/png;base64 instead.
Limits and tips
- To change the decoded picture’s size or format, download it and use the Image Converter.
- An animated GIF previews as animated, but Size reports only the canvas size.
- SVG sizes come from the width and height attributes, or the viewBox if those are missing.
Frequently asked questions
Do I need the data:image/…;base64, part at the start?
Why does it warn that the URI type does not match?
My string has line breaks and no = at the end. Will it work?
Which formats are recognised?
Is the string sent anywhere?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.