How to Convert a Base64 String Back to an Image
You have a wall of text that starts with `data:image/png;base64,` and you need the actual picture. Base64 strings show up in HTML source, CSS files, API responses, and config files — an image encoded as text. Decoding it turns that string back into a viewable, downloadable image file. This guide explains where these strings come from, how to decode them, and how to troubleshoot the common failures.
Where Base64 image strings come from
Developers embed images as Base64 to keep everything in one file or to move pictures through text-only channels. So you meet these strings when:
- Reading HTML or CSS that has an inline `data:` image.
- Inspecting an API response that returned an image as a Base64 field.
- Opening a config or JSON file with an embedded logo or icon.
- Someone pastes you a string instead of a file.
How to decode Base64 to an image with this tool
- Open the Base64 to Image tool.
- Paste the Base64 string (with or without the `data:` prefix).
- Preview the decoded image.
- Download it as a real image file.
Everything runs in your browser — nothing is uploaded.
Troubleshooting a string that will not decode
Base64 decoding is strict, so small problems break it:
- Include or exclude the prefix correctly. The `data:image/png;base64,` header tells the decoder the format. If decoding fails, try pasting only the part *after* the comma.
- Watch for truncation. A string copied from a narrow text box may be cut off. It must be complete to decode.
- Remove stray whitespace or line breaks that got introduced when the string was copied or wrapped.
- Confirm it is actually an image. Not every Base64 blob is a picture — some encode other file types.
The reverse trip
To go the other way and encode an image as Base64, Image to Base64 does it. Encode to embed an image as text; decode to get the image back. Once decoded, you can Convert Image Format or Resize Image as needed.
Common uses
- Extract an inline image from HTML or CSS.
- Save an image returned by an API.
- Recover a picture someone shared as text.
Privacy and limits
Decoding is fully local — no upload, no size cap, nothing stored, offline once loaded. Open the Base64 to Image tool to turn a string back into a picture.
Try the tool
Open Base64 to Image →