Decode a Base64 string to a viewable and downloadable image. Supports JPEG, PNG, GIF, WebP, SVG, and BMP. Preview before download, 100% client-side.
Paste a Base64 encoded image string to preview and download it as a file. This tool accepts both raw Base64 strings and complete data URIs (data:image/png;base64,…). The image format is detected automatically, and you can see a live preview before downloading. For all Base64 tools and reference material, visit the Base64 Hub.
You encounter Base64 encoded images in many contexts:
Many APIs return images as Base64 strings in JSON. AI image generation APIs (DALL-E, Stable Diffusion, Midjourney API) commonly return results this way. Payment QR codes, captcha images, and dynamically generated charts also arrive as Base64.
Applications that store images in database text columns use Base64 encoding. When you retrieve these records, you need to decode them to view or save the images.
Data URIs in <img> tags and CSS background-image properties contain Base64 images. Extracting the image from source code requires decoding the Base64 portion.
MIME encoded email attachments and inline images are Base64 encoded. Raw email source shows the Base64 data between MIME boundary markers.
Some JWT tokens embed small images (like user avatars or QR codes) in their payload claims. Decode the JWT first with the JWT Decoder, then decode the Base64 image data here.
This tool identifies the image format from the first few bytes of the decoded data:
| Base64 prefix | Format | MIME type |
|---|---|---|
/9j/ |
JPEG | image/jpeg |
iVBOR |
PNG | image/png |
R0lGOD |
GIF | image/gif |
UklGR |
WebP | image/webp |
PHN2Zy |
SVG | image/svg+xml |
Qk0 |
BMP | image/bmp |
If the input is a data URI, the MIME type from the prefix is used directly. For raw Base64 without a prefix, the tool falls back to byte signature detection.
// From data URI
const img = new Image();
img.src = 'data:image/png;base64,' + base64String;
// To downloadable file
const binary = atob(base64String);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
const blob = new Blob([bytes], { type: 'image/png' });
const url = URL.createObjectURL(blob);
import base64
from PIL import Image
from io import BytesIO
data = base64.b64decode(base64_string)
image = Image.open(BytesIO(data))
image.save('output.png')
echo "iVBORw0KGgo..." | base64 -d > output.png
The Base64 string may be truncated. Check that the length is a multiple of 4 and that no characters were lost during copy paste. Some text editors wrap long lines and introduce line breaks.
If the decoded file has the wrong extension, the content may still be valid. Try opening it in an image viewer that detects format from content rather than extension. This tool detects the actual format regardless of any claimed MIME type.
If the decoded image is unexpectedly large, the original may have been a high resolution uncompressed format. Consider converting to a more efficient format after decoding.
For the reverse operation, see Image to Base64 or format specific converters: JPG to Base64, PNG to Base64, SVG to Base64.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.