Decode Base64 strings to images
Convert Base64 strings to images instantly with our free online Base64 to image decoder. This tool helps developers decode Base64-encoded images back into viewable image files for download and use. Simply paste your Base64 string and get the decoded image in real-time.
No image decoded yet
Paste a Base64 string to decode and preview the image
This tool decodes Base64 encoded image data back into viewable images. It supports both plain Base64 strings and data URLs.
Supported formats:
iVBORw0KGgo...data:image/png;base64,iVBORw0KGgo...Supported image types: PNG, JPEG, GIF, WebP, and more
Base64 to Image conversion decodes Base64-encoded image data back into viewable or downloadable image files. This is essential for processing images from APIs that return Base64, extracting embedded images from HTML/CSS, or saving canvas drawings as image files.
The converter strips the data URI prefix if present, decodes the Base64 string to binary data, and either displays it directly, creates a downloadable blob, or saves as a file. The MIME type from the data URI determines the output format.
Data URI parsing: extract MIME type and Base64 data after the comma. atob() (browser) or base64.b64decode() (Python) converts to binary. Create Blob with correct type for downloads, or write binary to file for saving. Handle both raw Base64 and full data URI input.
Convert Base64 images from API responses to displayable images.
Profile pictures returned as Base64 in JSONSave canvas drawings as downloadable image files.
Extract and save images embedded in HTML or CSS.
Save inline Base64 images from HTML emails.
function downloadBase64Image(base64, filename) {
// Remove data URI prefix if present
const base64Data = base64.replace(/^data:image\/\w+;base64,/, '');
// Decode Base64
const binary = atob(base64Data);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
// Create blob and download
const blob = new Blob([bytes], { type: 'image/png' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
}Creates downloadable file from Base64. Works in all modern browsers.
import base64
import re
def save_base64_image(base64_string, filepath):
# Remove data URI prefix if present
if base64_string.startswith('data:'):
base64_string = re.sub(r'^data:image/\w+;base64,', '', base64_string)
# Decode and save
image_data = base64.b64decode(base64_string)
with open(filepath, 'wb') as f:
f.write(image_data)
# Usage
save_base64_image(api_response['avatar'], 'avatar.png')
# Detect format from data URI
def get_extension(data_uri):
match = re.match(r'data:image/(\w+);', data_uri)
return match.group(1) if match else 'png'Simple binary write after Base64 decode. Extract format from data URI if needed.
Use Base64 to Image when processing API responses with embedded images, saving canvas content, extracting images from HTML/CSS data URIs, or converting stored Base64 data to viewable files.
Use as src directly: <img src="data:image/png;base64,iVBORw0...">. In CSS: background-image: url(data:...). Or decode to Blob and create object URL for dynamic use.
GIF Viewer online tool. Fast processing, multiple format support, and quality preservation. Perfect for web developers, designers, and content creators.
Image Info online tool. Fast processing, multiple format support, and quality preservation. Perfect for web developers, designers, and content creators.
Image Resize online tool. Fast processing, multiple format support, and quality preservation. Perfect for web developers, designers, and content creators.