> decode | preview | download <

// Convert Base64 strings back to images with instant preview and download

// PASTE A data: URI HERE

Got a string that starts with data:image/png;base64, or data:image/jpeg;base64,? Paste it directly into the input field above — the decoder reads the MIME type from the prefix and skips format detection. You can also paste raw Base64 (no data: prefix) and the tool will sniff the magic bytes (iVBORw0KGgo for PNG, /9j/ for JPEG, R0lGOD for GIF, UklGR for WebP) to pick the right format automatically.

PNG data URI (1×1 transparent pixel)

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=

JPEG data URI

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/...

SVG data URI (text-encoded — also works inline)

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIvPjwvc3ZnPg==

Raw Base64 (no prefix — auto-detected as PNG)

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=

// Tip: when copying a data: URI from browser DevTools, the value is often truncated by the inspector. Paste from the source — your CSS file, HTML attribute, or API response — to get the full string. A truncated payload always decodes to a corrupted image.

0 chars
🖼️

Decoded image will appear here

[SECURE]

Local Processing

100% client-side Base64 decoding. Your data never leaves your browser.

[FAST]

Instant Preview

See decoded images immediately with format and size information.

[FREE]

No Limits

Decode any size Base64 string. No registration or API keys required.

// ABOUT BASE64 TO IMAGE CONVERSION

Supported Image Formats

  • >PNG - Lossless compression with transparency
  • >JPEG/JPG - Optimal for photos and complex images
  • >GIF - Animated images and simple graphics
  • >WebP - Modern format with superior compression
  • >SVG - Scalable vector graphics
  • >BMP - Uncompressed bitmap images
  • >ICO - Windows icon format

Common Use Cases

  • >HTML email embedded images
  • >Data URI implementation in CSS/HTML
  • >API response image processing
  • >Database BLOB to image conversion
  • >Web app offline image storage
  • >Mobile app image caching
  • >JSON payload image transmission

How Base64 to Image Conversion Works

Base64 decoding converts text-encoded binary data back to its original image format. Each group of 4 Base64 characters represents 3 bytes of binary data, achieving 75% efficiency. Our converter automatically detects image formats and creates downloadable files.

Example Data URI Format:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==

Performance & Browser Compatibility

  • >Client-side processing for maximum security
  • >Supports files up to browser memory limits
  • >Works in all modern browsers (Chrome, Firefox, Safari, Edge)
  • >No server uploads or data transmission required
  • >Instant conversion with real-time preview
  • >Mobile-friendly responsive interface

// IMAGE ENCODER, DECODER, AND VIEWER — SAME TOOL, DIFFERENT NAMES

What people call this tool

Search engines surface this page under dozens of names: Base64 image decoder, Base64 image converter, Base64 viewer, image to Base64 reverse, Base64 image preview. They all describe the same workflow — take a Base64 string, return the original image bytes, and render the image so you can verify it visually.

If you came here looking for an encoder (image → Base64 string), use our Image to Base64 converter instead. This page is the opposite direction: Base64 string → image. The two tools are inverses of each other.

Decoder vs. viewer vs. converter — is there a difference?

In practice, no. All three terms describe a tool that turns a Base64 string back into a viewable image. The technical work is identical: the Base64 alphabet (A-Z a-z 0-9 + /) is reversed back into raw binary bytes, then those bytes are handed to the browser's image renderer.

Decoder emphasizes the format conversion (text → bytes). Viewer emphasizes the preview (bytes → pixels on screen). Converter is the umbrella term. Our tool does all three in one click — paste the string, see the image, download the file.

When you'd reach for an image Base64 decoder

Debugging an API response — your backend returns { "avatar": "iVBORw0KGgo..." } and you need to confirm the bytes are a valid PNG before shipping the frontend code.

Inspecting a data URI — a CSS file or HTML attribute contains a long data:image/png;base64,... blob and you want to see what it actually depicts.

Recovering an embedded image — an email, a JSON config, or a database BLOB column has the image stored as Base64 text and you need to extract it back to a regular file.

Verifying email-template assets — HTML emails inline images as Base64 to bypass remote-image blocking. You can paste the inline string here to confirm rendering before sending the campaign.

Format auto-detection without specifying a MIME type

If your input lacks the data:image/...;base64, prefix, the decoder reads the first few decoded bytes (the magic number) to identify the format. 89 50 4E 47 means PNG. FF D8 FF means JPEG. 47 49 46 38 means GIF. 52 49 46 46 ... 57 45 42 50 means WebP. 3C 73 76 67 (the ASCII for <svg) means SVG.

This means you never need to manually tell the tool what format you have — paste the raw payload, click decode, and the correct image appears. The download button preserves the detected format automatically.

Privacy and offline behavior

Every byte of Base64 you paste is decoded inside your browser via JavaScript and the native Image constructor. Nothing is uploaded. Nothing is logged. Once the page is loaded, the decoder also works offline — useful when you're inspecting sensitive image data on an air-gapped machine or behind a strict corporate proxy.

// HOW TO USE BASE64 TO IMAGE CONVERTER

📝

Step 1: Paste

Paste your Base64 string or data URI into the input field

🔍

Step 2: Preview

Click decode to see instant image preview with details

📊

Step 3: Analyze

Review format, dimensions, and file size information

💾

Step 4: Download

Download the decoded image in its original format

// CODE EXAMPLES FOR DEVELOPERS

JavaScript (Browser)

// Decode Base64 to image
const base64String = 'data:image/png;base64,iVBORw0...';
const img = new Image();
img.src = base64String;
document.body.appendChild(img);

Simple browser-based Base64 to image conversion using the Image constructor.

JavaScript (Node.js)

const fs = require('fs');
const base64Data = 'iVBORw0KGgoAAAANSUhEUg...';
const buffer = Buffer.from(base64Data, 'base64');
fs.writeFileSync('decoded-image.png', buffer);

Server-side Base64 decoding to file using Node.js Buffer and filesystem.

Python

import base64
from io import BytesIO
from PIL import Image

base64_string = 'iVBORw0KGgoAAAANSUhEUg...'
image_data = base64.b64decode(base64_string)
image = Image.open(BytesIO(image_data))
image.save('decoded-image.png')

Python implementation using base64 library and PIL for image processing.

PHP

<?php
$base64String = 'iVBORw0KGgoAAAANSUhEUg...';
$imageData = base64_decode($base64String);
file_put_contents('decoded-image.png', $imageData);
echo 'Image decoded and saved!';
?>

PHP Base64 decoding using built-in base64_decode() function.

// FREQUENTLY ASKED QUESTIONS

Q: What is Base64 image decoding?

A: Base64 image decoding converts Base64 encoded strings back to their original image format (PNG, JPEG, GIF, etc.). Essential for viewing embedded images from data URIs, APIs, or databases.

Q: How secure is Base64 to image conversion?

A: 100% secure local processing. All Base64 decoding happens in your browser. Zero server uploads. Your images never leave your device.

Q: What image formats are supported?

A: Supports all common image formats: PNG, JPEG, GIF, WebP, SVG, BMP, ICO. Auto-detects format from Base64 data and MIME type headers.

Q: Can I decode data URI format?

A: Yes. Supports both data URI format (data:image/png;base64,...) and raw Base64 strings. Auto-detection included for both formats.

Q: What's the maximum file size for conversion?

A: No hard limits imposed by our tool. Limited only by your browser's memory capacity. Most browsers handle images up to 100MB+ without issues.

Q: Why use Base64 to image conversion?

A: Essential for HTML emails, data URIs in CSS/HTML, API image processing, database BLOB conversion, and offline web app development.

Q: Can I batch convert multiple Base64 strings?

A: Currently supports single image conversion. For batch processing, paste and convert each Base64 string individually.

Q: Does the tool work offline?

A: Yes, once loaded. All processing is client-side JavaScript. No internet connection required for conversion after initial page load.

Q: Are there any browser compatibility issues?

A: Works in all modern browsers (Chrome 4+, Firefox 3.6+, Safari 4+, Edge). IE8+ supported with some limitations on large files.

Q: How do I handle corrupted Base64 data?

A: Invalid Base64 strings will show an error message. Ensure proper encoding, check for missing characters, and verify data integrity.

Q: Can I convert Base64 to different image formats?

A: The tool preserves the original format embedded in the Base64 data. For format conversion, use the decoded image with an image editor.

Q: Is there an API available for developers?

A: Currently web interface only. For programmatic access, use the provided code examples in JavaScript, Python, PHP, or other languages.

Q: How do I decode a Base64 string to a PNG image?

A: Paste the Base64 string (with or without the data:image/png;base64, prefix) and click [DECODE]. The tool rebuilds the original PNG bytes, shows a live preview, and lets you download the file. A PNG Base64 payload always starts with iVBORw0KGgo — that is the 8-byte PNG magic number (89 50 4E 47 0D 0A 1A 0A) re-encoded in Base64, so you can tell at a glance that the data is a PNG.

Q: How do I decode a Base64 string to a JPG / JPEG image?

A: Drop the Base64 string in — the tool auto-detects the JPEG magic number (/9j/4AAQ in Base64, which is FF D8 FF E0 in raw bytes) and previews it with the correct MIME type. Download restores the original JPEG with its original quality, EXIF metadata, and dimensions intact. JPEG is the most common image format in APIs returning photos, avatars, and screenshots.

Q: How do I decode a Base64 string to a GIF?

A: Paste the string (the GIF magic prefix in Base64 is R0lGOD — either R0lGODlh for GIF87a or R0lGODdh / R0lGODlh for GIF89a). The preview animates automatically — all frames and the loop flag are preserved. Use the download button to save the animated .gif file.

Q: How do I decode a Base64 string to a WebP image?

A: Paste the string — the WebP magic in Base64 begins with UklGR (raw bytes 52 49 46 46, the RIFF container). The tool decodes both lossy and lossless WebP, animated or static, and renders it directly in the preview. WebP support is native in all modern browsers; only legacy IE cannot display the preview.

Q: How do I decode a Base64 string to an SVG image?

A: Paste the Base64 string. An SVG Base64 payload typically starts with PHN2Zy (<svg in Base64) or PD94bWw if it includes an XML declaration. Our decoder unpacks it, renders the vector graphic in the preview, and lets you download the .svg file. Because SVG is text-based, you can also open the downloaded file in a text editor to inspect or modify the markup.

Q: How do I tell which image format a Base64 string contains?

A: Check the beginning of the Base64 string against these common magic prefixes:
iVBORw0KGgoPNG
/9j/4AAQ or /9j/2wCJPEG / JPG
R0lGODGIF
UklGRWebP
PHN2Zy or PD94bWwSVG
QkBMP
AAABAAICO (Windows icon)
Our tool detects this automatically — you don't need to specify the format manually.

Q: What's the difference between a data URI and a raw Base64 string?

A: A data URI has the form data:[mime-type];base64,[payload] — the MIME type tells the browser what format the data is (e.g., image/png). A raw Base64 string is just the payload portion, without the data:...;base64, prefix. Our decoder accepts both: if the prefix is missing it inspects the decoded bytes and detects the format from the magic number automatically.

Q: Why is my decoded image broken or corrupted?

A: Common causes:
Truncated string — the Base64 value was cut off somewhere (e.g., by a newline or a character limit in the copy-paste source)
Invalid characters — the string contains whitespace, URL-safe characters (-_ instead of +/) mixed with standard, or an unexpected quote escape
Wrong MIME type — a PNG payload labeled data:image/jpeg will still decode bitwise but some viewers reject it; our tool uses the actual magic number, so the preview still works
Double-encoded — the data was Base64-encoded twice; run it through our Base64 decoder once more first

// OTHER LANGUAGES