Base64 to Image Converter

Decode raw Base64 strings or Data URIs back into downloadable PNG, JPG, SVG, WebP, GIF, BMP, or ICO images—100% in your browser.

100% Browser-Local · No Uploads · Free
Base64 or Data URI Input
Advanced Export Options Optional · Off by default

Default download saves the exact decoded bytes in their detected image format. Enable below only if you want to convert a decoded raster image to another format.

Decoded Image Preview

Decoded image preview will appear here automatically.

Detected Format
-
MIME Type
-
Dimensions
-
Decoded Size
-
File Size Comparison Waiting for Base64
Size reduction: —
Base64 Payload 0 B
Decoded Image 0 B
Paste any image Base64 string on the left to decode locally. 1 KB = 1,024 B
Zero sign-up · Runs locally in your browser

Real Base64 to PNG Decoding Example (96 Chars → 70 Bytes)

Base64 to Image converter decoding a 96-character Base64 string into a 1x1 transparent PNG (70 bytes, -27.1%)
Base64 to PNG decoding of a 96-character raw Base64 payload into a byte-exact 1×1 px transparent PNG (70 bytes, -27.1% size reduction) ready for local download.

Raw Base64 Input (96 chars, no Data URI header)

Leading bytes 89 50 4E 47 automatically detected as PNG

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==

Decoded PNG Inspection & Download (70 bytes, -27.1%)

Byte-exact binary reconstruction in browser memory

Detected Format: PNG (image/png)
Decoded Binary Size: 70 bytes (-27.1% vs Base64 text)
Dimensions: 1 x 1 px (alpha transparency preserved)
Download File: decoded-image.png (exact 70 original bytes)

How to Decode Base64 to Image Locally

Paste any Base64 payload into the left editor—or click Load .txt to read a local text file—to decode Base64 to image files automatically inside your browser. You do not need to strip formatting manually: the parser cleans line breaks, whitespace, URL-safe - / _ characters, and surrounding HTML <img src="..."> or CSS url(...) wrappers before reconstructing the binary Uint8Array.

  1. Paste or load your string: Accepts full Data URIs (data:image/png;base64,...), raw Base64 payloads, URL-encoded SVG Data URIs, or code snippets copied from HTML/CSS.
  2. Inspect detected metadata: The decoder reads the binary header (magic bytes) to identify the real image format, calculates the decoded byte size (typically ~25% smaller than the Base64 text), and renders a preview on a transparency checkerboard.
  3. Download the restored file: Click Download Image to save the exact decoded bytes with the proper file extension, or expand Advanced Export Options if you want to convert a decoded raster image to PNG, JPEG, or WebP.

Base64 to PNG: Decode a Base64 String into a PNG File

Converting Base64 to PNG is the most common decoding workflow for API responses, database thumbnails, and inline CSS icons. Even if your string arrives without the data:image/png;base64, header, every valid PNG Base64 payload begins with the recognizable iVBORw0KGgo prefix. When you paste that string here, the decoder reconstructs the binary buffer, verifies the 8-byte PNG magic-byte signature (89 50 4E 47 0D 0A 1A 0A), preserves full RGBA alpha transparency over the checkerboard preview, and prepares a byte-exact .png download.

For a real worked Base64 to PNG check, paste the 96-character string shown in the example above (iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==). The tool detects PNG (image/png) from its leading bytes, decodes it into an exact 1 × 1 px transparent image weighing 70 bytes (-27.1% smaller than the 96-byte Base64 text), and exports decoded-image.png with zero re-encoding or loss of alpha data.

Magic-Byte Format Signatures Automatically Detected

When you decode Base64 to image payloads without a data:image/...;base64, prefix—common in REST APIs, database columns, and log dumps—the tool inspects the leading bytes of the decoded binary buffer to detect the true format accurately:

Format Common Base64 Prefix Leading Hex Signature Output Extension
PNG iVBORw0KGgo 89 50 4E 47 0D 0A 1A 0A .png
JPEG / JPG /9j/ FF D8 FF .jpg
GIF R0lGOD 47 49 46 38 .gif
WebP UklGR 52 49 46 46 ... 57 45 42 50 .webp
SVG PHN2Zy or PD94bW UTF-8 <svg or <?xml + <svg .svg
BMP Qk 42 4D .bmp
ICO AAABAA 00 00 01 00 .ico

If your Base64 decodes cleanly to valid binary bytes that do not match a recognized image header (for example, plain text, a PDF, or a truncated payload), the tool reports the exact issue inline instead of generating a broken file.

Safe Previewing and Privacy Guarantees

Decoding unknown Base64 strings from third-party APIs or logs requires strict browser safety. All decoded outputs—including SVG graphics—are wrapped in a local Blob URL and rendered strictly inside an HTML <img> element, never inserted into the live DOM. That ensures embedded <script> blocks inside untrusted SVGs cannot execute.

Just like our main Image to Base64 encoder, no pasted text, decoded bytes, or filenames leave your computer, and nothing is written to persistent storage. Remember that visual previewing depends on your browser's image decoder; for uncommon BMP or ICO variants that a browser cannot paint inline, the tool still decodes the exact bytes and enables direct file download.

Base64 to Image FAQ

How do I convert a base64 string to a PNG file?

Paste your Base64 string (with or without the data:image/png;base64, prefix) into the input box on this page. The decoder automatically verifies the PNG magic bytes (89 50 4E 47), previews the transparent image over a checkerboard canvas, and lets you click Download Image to save the exact .png file locally.

Can I decode a raw Base64 string without a Data URI prefix?

Yes. You do not need the data:image/...;base64, prefix. The decoder inspects the decoded binary magic bytes to detect PNG, JPEG, GIF, WebP, SVG, BMP, and ICO automatically.

What happens if I paste an HTML img tag or CSS url() snippet?

Yes. If you paste an entire HTML img tag or a CSS background-image: url(...) rule, the tool automatically extracts the embedded Data URI and ignores surrounding markup and whitespace.

Why does my Base64 string show an invalid format or decoding error?

The tool validates both the Base64 alphabet and length modulo 4, as well as the resulting image header. If characters are corrupted or truncated, an inline error explains exactly what failed so you can spot broken copy-pastes quickly.

Is it safe to preview an untrusted Base64-encoded SVG here?

Yes. Decoded SVG strings are rendered strictly via a Blob URL inside an HTML img tag rather than injected into page DOM, preventing any embedded scripts inside the SVG from running.

Can I convert the decoded image to a different format before downloading?

By default, Download Image saves the exact decoded bytes in their original format. To convert a raster image (such as PNG to WebP or JPEG), open Advanced Export Options below the input box. Canvas conversion is disabled for SVG and GIF to protect vector data and animation frames.

Does this Base64 to Image decoder log or store my pasted strings?

Nothing is uploaded or saved. Decoding runs entirely inside browser memory using native JavaScript APIs, and the temporary Blob URL is revoked as soon as you clear the editor or leave the page.