To convert Base64 to an image, you decode the text back into the picture it was made from. Base64 is a way of writing binary data, like a photo or an icon, as plain text so it can travel inside HTML, CSS, JSON, or an email. That text looks like a long random string, but it is a complete image waiting to be turned back. This guide shows how to convert Base64 to an image or a PDF, and what to do when the string will not decode.
In this guide
Why files become Base64
Many systems only handle plain text safely. Email bodies, JSON payloads, and the data URLs embedded in web pages were all built around text, and raw binary sent through them can be corrupted. Base64 solves that by rewriting the binary file as text characters, so an image can be carried inside a line of CSS or a JSON field. The trade-off is size, since Base64 text is about a third larger than the original, and that it is unreadable until decoded. The full background is in our guide to Base64 encoding.
When you receive data in that form, you need to reverse it, and that is exactly what these converters do.
Convert Base64 to an image
The Base64 to image converter takes a Base64 string and rebuilds the original picture, which you can then view or save as a normal file. It handles the common formats, so a string that started as a PNG comes back as a PNG and a JPEG comes back as a JPEG. You paste the string, and the image appears.
If your data is specifically a WebP image, the Base64 to WebP converter rebuilds it in that format directly.
Preview a Base64 image
Sometimes you only need to see what a Base64 string contains, not save it. The Base64 image preview tool renders the image straight from the string so you can check it at a glance. This is handy when you are debugging and have a long encoded value but no idea what picture is hiding inside it.
Convert Base64 to PDF
Images are not the only files encoded this way. Documents are often carried as Base64 inside API responses and stored data. The Base64 to PDF converter decodes the string back into a working PDF you can open and save, the same idea as the image converter applied to documents.
When the string will not decode
If a converter rejects your string, the cause is usually one of two things. The first is the data URL prefix. A Base64 image copied from a web page often starts with something like data:image/png;base64, before the actual data. That prefix is not part of the Base64 itself, and some tools want only the part after the comma.
The second is a broken or incomplete string, where characters were lost in copying or the padding equals signs at the end were cut off. A quick way to sanity-check what you have: a Base64 PNG begins with the characters iVBOR, and a Base64 JPEG begins with /9j/. If yours starts with one of those, the data is probably intact and the prefix is the thing to remove.
Free Base64 converters used in this guide
Frequently asked questions
How do I convert a Base64 string to an image?
Paste the string into a Base64 to image converter. It decodes the text back into the original picture, which you can then view or save as a file.
What does the data:image prefix mean?
It is a data URL prefix that marks the string as an embedded image. It is not part of the Base64 data, and some converters want only the part after the comma.
Can I tell what format a Base64 image is?
Often yes. A Base64 PNG starts with the characters iVBOR, and a Base64 JPEG starts with /9j/, which gives away the format before you decode it.
Why is my Base64 string larger than the original file?
Base64 represents three bytes of data as four text characters, so the encoded text is about a third larger than the file it came from.
Can I convert Base64 back to a PDF?
Yes. A Base64 to PDF converter decodes the string into a working PDF document you can open and save.