How to use Base64 to Image
- 1Paste the Base64 string into the box
- 2A full data URL or a bare payload both work
- 3The decoded image appears immediately if the string is valid
- 4Check it is the picture you expected
- 5Download it as a file
What Base64 to Image does
Base64 strings turn up wherever an image has had to travel through something that only carries text — a JSON API response, a stylesheet, a database column, an email source, a log file. They are unmistakable: a long unbroken run of letters and digits, often beginning `data:image/png;base64,`.
Decoding is exactly reversible, so what comes out is byte-for-byte the file that went in. Nothing is lost or approximated. When decoding fails it is almost never the encoding's fault — it is that the string arrived incomplete or with something inserted into it along the way.
When to use it
- Extracting an image from an API response
- Services that return images inside JSON send them Base64-encoded. Decoding is how you actually see what came back.
- Recovering an image from source code
- An icon embedded in a stylesheet or an HTML file can be pulled back out as a file, which is often the only copy that still exists.
- Checking what a string contains
- A long Base64 blob in a log or a database gives no clue what it is. Decoding shows you immediately.
- Debugging an upload
- When an image submitted as Base64 arrives wrong, decoding the received string shows whether the problem happened before or after transmission.
Base64 to Image settings explained
- Full data URL
- A string beginning `data:image/png;base64,` is accepted as-is. The prefix declares the image type, which is how the browser knows what it is decoding.
- Bare payload
- A string without the prefix also works — the type is inferred from the decoded bytes. Useful for strings pulled out of JSON fields or database columns, where the prefix is often stripped.
- Immediate preview
- The decoded image is displayed as soon as the string parses, so you can confirm it is what you expected before downloading anything.
- Download as a file
- The decoded bytes are saved with the correct extension for the detected type, giving you back an ordinary image file.
Why decoding fails
| Symptom | Usual cause | Fix |
|---|---|---|
| Nothing appears | String is truncated | Copy the whole value again |
| Nothing appears | Line breaks inserted | Remove all whitespace |
| Partial or corrupt image | Copy stopped early | Check the string's end |
| Wrong file extension | Prefix missing or wrong | Include the data: prefix |
Limits and what to expect
- Only images are decoded; a Base64 string containing a PDF or another file type will not display.
- Truncated strings cannot be recovered — the missing bytes are simply absent.
- Very long strings can be slow to paste and render, since the whole image is held in the page.
- URL-safe Base64, which substitutes different characters for + and /, is not the standard variant and may not decode.
- The decoded image is exactly what was encoded; nothing is repaired or improved.
Troubleshooting
- Nothing appears when I paste the string
- It is almost certainly incomplete. Base64 strings are long and easy to cut short when selecting by hand or when a viewer truncates a field. Copy the entire value again, ideally programmatically rather than by selection.
- The image is only partly there
- The string was cut off partway. Base64 decodes sequentially, so a truncated string produces the first part of the image and then stops. The missing data cannot be reconstructed.
- The string has line breaks in it
- Some formats wrap Base64 at a fixed width, and some editors insert breaks when pasting. Remove all whitespace so the string is one unbroken run of characters.
- The downloaded file has the wrong extension
- The type is taken from the `data:` prefix when one is present. Without it, the type is inferred from the decoded bytes, which usually works but can be wrong for unusual formats. Include the full data URL where you can.
Your files and your privacy
Decoding happens entirely inside your browser, with no request to a server. That matters more than it might appear: a Base64 string is the complete image in text form, so pasting one into a hosted decoder means uploading the image itself, whatever the page says about not storing files.
What to use next
FAQ
What is a Base64 image string?
An image's binary data rewritten using only printable characters, so it can travel through anything that carries text — JSON, CSS, HTML, a database column. It usually starts with `data:image/png;base64,` followed by a long run of letters and digits.
Why is my string not decoding?
Almost always because it is incomplete. Base64 strings are long and easily truncated when copied by hand or displayed in a field that cuts them off. Line breaks inserted by an editor are the second most common cause. Copy the whole value and remove any whitespace.
Do I need the data:image prefix?
No, a bare payload works too — the image type is inferred from the decoded bytes. Including the prefix is more reliable, though, because it states the type explicitly rather than leaving it to be guessed.
Does decoding lose any quality?
No. Base64 is a completely reversible encoding, so what comes out is byte-for-byte the file that went in. If the decoded image looks poor, it was already poor before it was encoded.
Can I decode a Base64 PDF or other file?
Not with this tool, which displays images only. The same encoding is used for every file type, but this decoder expects the bytes to be a viewable image.
Is my string uploaded anywhere?
No. Decoding runs in your browser with no network request. Since the string is the entire image, that is the difference between a local tool and a hosted one.