This free Base64 to image converter turns encoded text back into a picture you can see and save. Paste a raw Base64 string or a full data URI, and the tool will decode it, detect the image type, and show a preview. It’s an online Base64 decode tool built for images: PNG, JPG, GIF, WebP, BMP and SVG all work.
It also understands pasted code. If you paste an HTML <img> tag or a CSS url() rule, it finds the data URI inside. Everything runs in your browser, so your data stays on your device.
Why use this Base64 to image converter
- Accepts messy input. Raw Base64, data URIs, img tags, and CSS rules all work. Line breaks and spaces are removed for you.
- Detects the file type. It reads the data URI prefix, or the file’s first bytes when there is no prefix.
- Preview before saving. You see the decoded image, its size in pixels, and its file size.
- Convert while you download. Save as PNG, JPG or WebP, or keep the original format.
- No signup, no upload. It’s free, and the decoding happens on your device.
Step-by-step guide
1. Get the Base64 text
Copy the string from your API response, database field, HTML file, or CSS file. Copy all of it. A cut-off string decodes to a broken image or fails to decode.
2. Paste and decode
Paste into the box, or click Paste from clipboard. Then click Decode image. The preview shows up below the buttons, along with the detected type and dimensions.
3. Choose a format and download
Keep the original format for an exact copy of the decoded file. Choose PNG for lossless output, JPG for smaller photos, or WebP for modern, compact files. Converting a transparent PNG to JPG fills the background with white.
Want to go the other way? Use the Image to Base64 Converter. If the decoded image is too large, try Resize Image or Compress Image File.
Supported formats, specs and limits
| Item | Detail |
|---|---|
| Input | Raw Base64, data URI, HTML img tag containing a data URI, CSS url() with a data URI |
| Detected image types | PNG, JPG, GIF, WebP, BMP, SVG (others are used if the prefix names an image type your browser can show) |
| URL-safe Base64 | Supported (- and _ are converted) |
| Missing padding | Fixed automatically |
| Max input size | About 15 million characters |
| Output formats | Original, PNG, JPG (quality about 92%), WebP (quality about 92%) |
| Not supported | Base64 that decodes to non-image files, such as PDF or ZIP |
How Base64 decoding works
Base64 writes binary data with 64 text characters. Decoding reverses it: every 4 characters become 3 bytes of the original file. Those bytes are the image file itself, exactly as it was before encoding.
A data URI looks like data:image/png;base64,iVBORw0.... Before the comma is the type. After it is the data. A raw string has no prefix, so the tool checks the first bytes. PNG files start with the bytes that encode to iVBORw0KGgo, JPG files usually start with /9j/, GIF with R0lGOD, and WebP with UklGR.
Decoding in your own code
// Browser JavaScript
const img = new Image();
img.src = 'data:image/png;base64,' + base64String;
# Python
import base64
open('out.png', 'wb').write(base64.b64decode(base64_string))
Use cases
- Developers checking what image an API returned in a Base64 field.
- QA testers confirming that an uploaded image was stored correctly.
- Front-end developers extracting an inline icon from old CSS.
- Email designers recovering an embedded logo from an HTML template.
- Data analysts opening images stored as text in a database or JSON export.
- Students learning how Base64 encoding and decoding work.
Expert tips and common mistakes
- Copy the whole string. Missing the last few characters is the most common cause of a broken image.
- Check for escaped slashes. JSON sometimes writes
/as\/. Remove the backslashes before pasting. - Remove surrounding quotes. The tool handles most cases, but stray characters inside the string can break decoding.
- Match the format to the content. Use JPG for photos and PNG for graphics with sharp edges or transparency.
- Don’t convert JPG to PNG to “improve” it. It won’t restore lost detail. It only changes the container.
- Watch for “+” turned into spaces. URLs and forms can replace plus signs. The tool strips spaces, but the data may already be damaged.
Privacy and security
Your Base64 data is processed in your browser and is never uploaded. The page decodes the text with built-in browser functions, creates a temporary local link for the preview, and draws the image on a canvas only if you choose to convert it. No data is sent to a server.
Be careful with what you decode. A Base64 image from an unknown source is just an image, but it may show content you don’t expect. Never paste secrets, such as private keys or passwords, into any online tool unless you’re sure how it works.
This tool vs alternatives
| This browser tool | Command line | Server-based sites | |
|---|---|---|---|
| Setup | None | Terminal and correct command | None |
| Data leaves your device | No | No | Often yes |
| Instant preview | Yes | No, you open the file after | Varies |
| Format conversion on download | PNG, JPG, WebP | Needs extra tools | Varies |
| Best for | Quick checks and one-off files | Scripts and batches | Convenience |
Troubleshooting
- “This doesn’t look like valid Base64.” The text contains characters Base64 doesn’t use. Remove extra words, quotes or escape characters.
- “Decoded, but it isn’t an image.” The data might be a PDF, a ZIP, or text. This tool only shows images.
- The preview is broken. The string is probably cut off. Copy it again in full.
- Colors or transparency look wrong. You may have converted to JPG, which has no transparency. Use PNG or WebP.
- Paste from clipboard does nothing. Your browser may block clipboard access. Press Ctrl+V (or Cmd+V) in the box instead.
- The page is slow. Very long strings are heavy. Try a smaller image, or decode large files with a script.
Glossary
- Base64: a way to write binary data using 64 printable characters.
- Data URI: a URL that contains the file itself, beginning with
data:. - MIME type: the name of a file’s format, like
image/png. - Padding: the
=characters at the end of some Base64 strings. - Magic bytes: the first few bytes of a file, which identify its format.
Frequently asked questions
Is this Base64 to image converter free?
Yes. You can decode as many strings as you like at no cost. There are no credits, trials, or paid tiers, and no watermark is added to the images you download.
Is it safe to paste my Base64 data here?
Your data is decoded in your browser and is not uploaded. No server receives the text or the image. Still, avoid pasting secrets like passwords or private keys into any online tool.
Do I need to sign up?
No. There’s no account, login, or email request. Open the page, paste your Base64 text, decode it, and download the image. Nothing is saved because there’s nowhere to save it.
Do I need the data:image prefix?
No. The tool accepts a raw Base64 string without any prefix. When the prefix is missing, it identifies the image type from the file’s first bytes. A full data URI also works, as does an img tag.
Is there a size limit?
The input can be about 15 million characters, which is roughly an 11 MB image. Very large strings can slow your browser, since the text has to fit in a text box. Smaller images decode instantly.
Does it work on mobile?
Yes. The layout is responsive and the buttons are sized for touch. Paste your string into the box, tap Decode image, and download the result to your phone’s files or gallery.
Can I convert Base64 to PDF here?
No. This tool decodes images only. If your Base64 contains a PDF, it will report that the decoded data isn’t an image. Decoding a PDF needs a different tool built for documents.
Why does my Base64 string fail to decode?
Common causes are a cut-off string, extra quotes, escaped slashes, or text that isn’t Base64 at all. Copy the full string again, remove any surrounding characters, and check that it only has letters, numbers, plus, slash and equals signs.
Is Base64 decoding the same as decryption?
No. Base64 is an encoding, not encryption. Anyone can decode it without a key. That’s why this tool needs no password, and why Base64 shouldn’t be used to protect private data.
Conclusion
Turning a Base64 string back into an image should take seconds, not setup. This free online Base64 to image converter decodes your text, shows the picture, and lets you download it as PNG, JPG or WebP. Paste your string above and see what’s inside. Need to encode images instead? Try the Image to Base64 Converter.