Guide
Decoding Base64 strings and data URLs back into image files
Images travel as text more often than you might think: in JSON responses from APIs, inside HTML emails, embedded in CSS as background images, stored in databases and printed into log files. That text is Base64, a way of writing binary data with 64 safe characters. Paste such a string here to see the picture, find out what format it really is and save it as a normal file.
Data URLs and plain Base64
A data URL looks like data:image/png;base64, followed by a long run of letters, digits, plus signs and slashes. The part before the comma declares the type; the rest is the image. Plain Base64 is just the long run without the header. SVG images are sometimes embedded without Base64 at all, as percent-encoded text such as data:image/svg+xml,%3Csvg…; those are understood too.
Copy mistakes that are fixed for you
Strings copied from code rarely arrive clean. The decoder removes surrounding quotes and CSS url( ) wrappers, strips spaces and line breaks added by email clients or log formatters, decodes URL escapes such as %2B, converts the URL-safe alphabet that uses minus and underscore, and restores missing = padding at the end. A note above the preview lists every repair, so you know exactly what was changed.
Real format detection
The declared type is not trusted. After decoding, the first bytes of the data identify the actual format: PNG, JPEG, GIF, WebP, AVIF, BMP, ICO, TIFF, SVG and others. If a data URL claims image/png but contains a JPEG, a warning tells you to fix the MIME type in your code, since some email clients and libraries rely on the label.
Reading the details
Below the preview you see the format, the pixel dimensions, the decoded size and how many characters the Base64 used, with the overhead in percent. Very small images are shown enlarged with hard pixel edges, so a 16-pixel icon is still visible. Download the original bytes with the correct extension, or convert to PNG, JPG or WebP in one step.
Diagnosing broken strings
When decoding fails, the message says why. An invalid character is named with its position, which usually points to a stray quote, an HTML entity or a character inserted by a text editor. A string whose length leaves one character over at the end has been cut off; this happens with log lines that are truncated at a fixed length. Truncated data cannot be repaired, because the missing part of the image is simply gone; copy the full value from the source instead.
The reverse direction
To embed a file as Base64, use Image to Base64, which produces data URLs, CSS and HTML snippets. For Base64 that contains text rather than an image, the Base64 Encoder decodes and encodes plain strings. Everything happens in your browser, which matters when the data comes from private API responses or customer records.
Security and privacy when decoding
Base64 from an API or a database can contain personal photos, signatures or scanned IDs. Pasting it into an online decoder usually means sending it to someone else’s server; here the string is decoded in your browser and never transmitted. The picture is drawn through the browser’s image decoder, which does not run scripts, so even an SVG with embedded JavaScript is shown as an inert image. If you work with untrusted data regularly, this is a safe way to look inside it without opening files on your desktop.
Checked against the current version of the Base64 to Image on .

