Free online decoder
Base64 to Image Converter
Paste a Base64 string and get the picture back instantly. The format is detected automatically and everything runs in your browser, so your data never leaves this device.
Your image appears here
Nothing is uploaded. Decoding happens on this device.
- Format
- —
- Dimensions
- —
- File size
- —
- Base64 length
- —
- Private by design
- Real format detection
- No limits, no account
How to convert Base64 to an image
Paste the string
Drop in raw Base64 or a full
data:image/...;base64,URL. Quotes, line breaks and CSSurl()wrappers are cleaned up automatically.See it decode
The format is read from the file signature, not guessed, and the picture renders at once with its dimensions and size.
Save the image
Download the original file, re-encode it as PNG, JPG or WebP, or copy it straight to your clipboard.
Built for the way developers work
Private by design
Decoding runs in JavaScript on your device. The string is never sent to a server, so tokens, screenshots and customer data stay with you.
Real format detection
Magic bytes identify PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF even when the data URL prefix is missing or wrong.
Forgiving input
Handles URL-safe Base64, missing
=padding, wrapped lines, JSON-escaped strings and surrounding quotes.Exact file details
Shows pixel dimensions, decoded file size and string length, which is handy when checking API payloads.
Format conversion
Re-encode any decoded picture to PNG, JPG or WebP without leaving the page.
No limits, no account
Free to use with no sign-up, no watermark and no daily quota.
What is a Base64 image?
Base64 is a way of writing binary data using 64 printable characters: A–Z, a–z, 0–9, + and /. It is defined in RFC 4648. Every 3 bytes of the file become 4 characters of text, so a Base64 image is about 33% larger than the original file.
A data URL, defined in RFC 2397, wraps that text with a media type so a browser can render it directly: data:image/png;base64,iVBORw0KGgo.... This is how small images are embedded inside HTML, CSS, JSON API responses, emails and SVG files.
Converting Base64 to an image reverses the process. The text is decoded back to the original bytes and saved as a normal image file, identical to the one that was encoded.
Image formats and their Base64 signatures
The first characters of a Base64 string reveal the image format, because every format starts with fixed signature bytes.
| Format | MIME type | Base64 starts with | Transparency | Animation | Best for |
|---|---|---|---|---|---|
| PNG | image/png | iVBORw0KGgo | Yes | No | Logos, icons, screenshots |
| JPG | image/jpeg | /9j/ | No | No | Photographs |
| GIF | image/gif | R0lGOD | Yes | Yes | Short simple animations |
| WebP | image/webp | UklGR | Yes | Yes | Smaller web images |
| SVG | image/svg+xml | PHN2Zy | Yes | Yes | Scalable icons and illustrations |
| BMP | image/bmp | Qk | No | No | Uncompressed legacy bitmaps |
| ICO | image/x-icon | AAABAA | Yes | No | Favicons |
| AVIF | image/avif | AAAA | Yes | No | Modern high-efficiency photos |
Decode Base64 to PNG in code
When you need to do the same thing in a script, these snippets write a Base64 string to an image file.
const img = new Image();
img.src = `data:image/png;base64,${b64}`;
document.body.append(img);import { writeFileSync } from 'node:fs';
writeFileSync('image.png', Buffer.from(b64, 'base64'));import base64
with open("image.png", "wb") as f:
f.write(base64.b64decode(b64))base64 --decode image.txt > image.pngFrequently asked questions
How do I convert Base64 to an image?
Paste the Base64 string or data URL into the input box. The image is decoded and shown immediately, and the Download button saves it as a file. No upload or sign-up is needed.
Is my Base64 data uploaded to a server?
No. Decoding is done by JavaScript inside your browser. The string and the resulting image are never transmitted, which makes the tool safe for private or sensitive pictures.
Which image formats are supported?
PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF. The format is detected from the file signature, so it works even without a data:image/... prefix.
Do I need the data:image prefix?
No. You can paste raw Base64 such as iVBORw0KGgo... or a complete data URL. The converter adds the correct media type for you.
Why does my Base64 string not decode?
The usual causes are a truncated string, characters lost while copying, or data that is not an image at all. A valid PNG starts with iVBORw0KGgo and a JPEG with /9j/.
Is there a size limit?
There is no fixed limit. Strings of tens of megabytes decode fine on a modern computer; the practical ceiling is the memory available to your browser.
How do I convert Base64 to an image online?
Paste your Base64 text or data URL into the box above and the online converter decodes it to a picture immediately, all inside your browser. There is nothing to install and no file is uploaded, so you can convert Base64 to an image for free.
Is b64 the same as Base64?
Yes. b64 is just a short way to write Base64, and “base 64” with a space means the same thing. A search for b64 to image or base 64 to image describes exactly what this tool does: turn a Base64 string into a picture.
Can I download the decoded image in its original format?
Yes. After the Base64 is decoded, use Download to save the original PNG, JPG, GIF, WebP or SVG, or re-encode it to PNG, JPG or WebP first. The download stays on your device and carries no watermark.