Base64 to Image
Decode a Base64 string or data URI back into a viewable image. Supports plain Base64 with manual MIME type selection, URL-safe Base64, and direct data URI input. Preview and download the result.
The Base64 to Image Converter is a free, browser-based tool that decodes a Base64 string or a full data URI back into a viewable image. Paste the encoded string, click Decode, preview the result, and download the image file. All processing runs entirely in your browser — nothing is uploaded.
Features
| Feature | Detail |
|---|---|
| Data URI support | Automatically parses data:image/...;base64,... strings |
| Plain Base64 support | Decodes raw Base64 without a data URI prefix — just select the MIME type |
| MIME type detection | Extracts the MIME type automatically from the data URI header |
| MIME type selector | Manually specify PNG, JPEG, GIF, WEBP, SVG, BMP, AVIF, or ICO when using plain Base64 |
| URL-safe Base64 | Converts URL-safe characters (- and _) to standard Base64 before decoding |
| Image preview | Displays the decoded image with a transparency checkerboard background |
| Dimension and size stats | Shows image dimensions, estimated file size, and Base64 string length |
| Download | Save the image to your device with a custom file name and extension |
| Auto-hide MIME selector | The MIME selector is hidden automatically when a full data URI is pasted |
How to Use
- Paste a Base64 string or a full data URI into the input area.
- If pasting a plain Base64 string (no
data:prefix), select the correct image type from the Image type dropdown. - Click Decode Image.
- Review the image preview and the stats bar.
- Enter a file name, choose the extension, and click Download.
Data URI vs Plain Base64
A data URI is a self-describing string that includes the MIME type:
data:image/png;base64,iVBORw0KGgoAAAANS...
A plain Base64 string is just the encoded data, with no type information:
iVBORw0KGgoAAAANS...
When you paste a plain Base64 string, the tool shows the Image type selector so you can specify the format. If you paste a full data URI, the MIME type is parsed from the header automatically and the selector is hidden.
URL-safe Base64
Some systems encode binary data in the URL-safe Base64 variant, which replaces + with - and / with _ to make the string safe for use in URLs and filenames without percent-encoding. This tool automatically converts URL-safe characters back to standard Base64 before decoding, so both variants are supported without any manual adjustment.
Supported Image Formats
The tool supports any image format that the browser can render. Common formats include:
| Format | MIME type | Notes |
|---|---|---|
| PNG | image/png |
Lossless, supports transparency |
| JPEG | image/jpeg |
Lossy, no transparency, smaller file size |
| GIF | image/gif |
Up to 256 colours, supports animation |
| WEBP | image/webp |
Modern format, lossless or lossy |
| SVG | image/svg+xml |
Vector, scalable, text-based |
| BMP | image/bmp |
Uncompressed raster format |
| AVIF | image/avif |
Next-generation format, excellent compression |
| ICO | image/ico |
Windows icon format |
Use Cases
Verifying Inline Images
When debugging HTML or CSS that includes data URI images, paste the Base64 value here to confirm the image is encoded correctly and displays as expected.
Extracting Embedded Images
HTML emails, PDF extracts, and API responses often contain Base64-encoded images. Use this tool to decode and save them as standalone files.
API Response Inspection
REST APIs that return image data as Base64 strings (such as face recognition, barcode generation, or screenshot APIs) can be decoded here to verify the response without writing code.
Development and Testing
Quickly preview any Base64 image string you encounter during development — from localStorage values, JWT payloads, or API mock responses.
Email Template Work
Email HTML often includes embedded images as data URIs to avoid external image blocking. Paste the data URI here to preview and verify the image before sending.
Frequently Asked Questions
What is the maximum Base64 string length this tool can handle?
There is no fixed limit. The browser processes the string entirely in memory, so very large Base64 strings (representing multi-megabyte images) may take a moment to decode depending on your device.
Why does the image fail to load even though my Base64 string looks valid?
The most common cause is a MIME type mismatch — the selected type does not match the actual encoded image format. Try selecting a different type from the dropdown. Another cause is truncated or corrupted Base64 data.
What is the "estimated file size" in the stats bar?
Base64 encodes 3 bytes as 4 characters. The estimated file size is calculated by reversing this ratio: floor(base64_length * 3 / 4) - padding_bytes. It is an approximation; the actual file size may differ slightly due to image format overhead.
Can I decode Base64 strings that use URL-safe encoding?
Yes. The tool automatically replaces - with + and _ with / before decoding, so URL-safe Base64 strings work without any manual adjustment.
Does this tool support animated GIFs?
Yes. If the Base64 string represents an animated GIF, the browser will display the animation in the preview. The downloaded file will also preserve the animation.