Base64 to Image Decoder
Paste your Base64 encoded string and instantly preview and download the image. Supports PNG, JPEG, GIF, WebP, SVG. 100% client-side — your data never leaves your browser.
How to Decode Base64 to Image
Paste
Paste your Base64 string into the text area above. Accepts raw Base64 or a full data URI with MIME type prefix.
Preview
Click Decode Image to instantly preview the decoded image. Format, dimensions, and file size are auto-detected.
Download
Click Download Image to save the file to your device. The correct file extension is applied automatically.
What is Base64 Image Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It uses 64 characters — the letters A–Z, a–z, the digits 0–9, and two additional symbols (+ and /) — to represent arbitrary binary data as plain text. The name "Base64" comes from this 64-character alphabet.
When an image is Base64-encoded, every 3 bytes of the original binary file are represented as 4 ASCII characters. This means Base64-encoded data is approximately 33% larger than the original binary, but the trade-off is that the data can be safely embedded in text-based formats like HTML, CSS, JSON, XML, and email messages.
A Base64-encoded image is often wrapped in a data URI format: data:image/png;base64,iVBORw0KGgo.... The prefix specifies the MIME type (image/png, image/jpeg, etc.) and the encoding (base64), followed by the actual encoded data. This data URI can be used directly in an HTML <img> tag's src attribute or in CSS background-image properties, allowing the image to be embedded inline without a separate HTTP request.
Common Use Cases
Email attachments (MIME)
Email protocols (SMTP) are text-based and cannot transmit raw binary data. Base64 encoding is the standard method for embedding images and attachments in email messages via MIME (Multipurpose Internet Mail Extensions). When you need to extract an image from a raw email source, you will encounter Base64-encoded data that this tool can decode.
CSS background images
Small images like icons, logos, and UI elements can be embedded directly in CSS as Base64 data URIs. This eliminates additional HTTP requests and is commonly used in performance-optimized stylesheets. Decoding these strings lets you extract and edit the original image files.
Single-file HTML documents
Self-contained HTML files — used for reports, documentation, and dashboards — embed all assets as Base64 to work without external dependencies. If you receive such a document and need to extract an image, paste its Base64 string here to get the original file.
API responses & JSON payloads
Many APIs return images as Base64-encoded strings within JSON responses. This is common in document processing APIs, OCR services, screenshot APIs, and image generation tools. Decoding the response lets you preview and save the image without writing code.
Supported Image Formats
This decoder auto-detects the image format from the Base64 data header or the data URI MIME type. The following formats are supported:
| Format | Extension | Detection Method | Notes |
|---|---|---|---|
| PNG | .png | Header: iVBOR |
Lossless compression, transparency support |
| JPEG | .jpg | Header: /9j/ |
Lossy compression, photos |
| GIF | .gif | Header: R0lGOD |
Animation support, 256 colors |
| WebP | .webp | Header: UklGR |
Modern format, lossy & lossless |
| SVG | .svg | Header: PHN2Zy / PD94bW |
Vector graphics, XML-based |
| BMP | .bmp | Header: Qk0 |
Uncompressed bitmap |
| ICO | .ico | Header: AAABAA |
Favicon / icon format |
Frequently Asked Questions
iVBORw0KGgo...) or a full data URI (e.g., data:image/png;base64,iVBORw0KGgo...). The prefix is stripped automatically and the MIME type is used for format detection.