Base64 to Image Converter

Paste a Base64 string or data URI. Preview the image instantly and download it. Auto-detects format.

Base64 Input
0 chars
Paste a Base64 string or data URI above.

How to Decode a Base64 Image

  1. Paste the string — either a full data URI (data:image/png;base64,...) or a raw Base64 string.
  2. Preview loads instantly — the image renders in the preview box. Format, dimensions, and file sizes are shown.
  3. Download — click Download to save the image file. Choose a specific format in the dropdown to convert it.
  4. Copy data URI — use the Copy Data URI button if you need to re-embed the image elsewhere.

Understanding Base64 Image Data

Base64 encoding converts binary image data into a string of printable ASCII characters. This makes it possible to embed images in HTML, CSS, JSON, API responses, and any text-based format. The reverse process — decoding Base64 back to an image — is equally common. Developers encounter Base64 images when working with REST APIs that return embedded thumbnails, database records that store images as text, email HTML templates, JSON configuration files, and browser localStorage or IndexedDB.

Data URI Format

A complete data URI has three parts separated by commas and colons: the scheme (data:), the media type with encoding (image/png;base64), and the encoded data. The media type tells the browser what kind of data follows. When you paste a data URI into this tool, the MIME type is extracted from the prefix to ensure the downloaded file has the correct extension and format.

Raw Base64 Without a Data URI Prefix

Sometimes you have just the raw Base64 string without the data:image/... prefix. This happens when working with APIs, databases, or tools that store only the encoded bytes. In this case, this tool reads the first few decoded bytes (called magic bytes or file signatures) to identify the format: PNG files start with \x89PNG, JPEG files start with \xFF\xD8\xFF, GIF files start with GIF87a or GIF89a, and WebP files start with RIFF...WEBP.

Downloading in a Different Format

The download format selector lets you convert the image to PNG, JPEG, or WebP on download. This works by drawing the decoded image onto an HTML canvas element and then exporting the canvas in the desired format. Note that converting to JPEG will lose any transparency channel — transparent pixels become white on a JPEG background. PNG and WebP both support transparency.

Common Base64 Issues

The most common problem with Base64 strings is extra whitespace — line breaks, spaces, and tabs are not valid Base64 characters and will cause decoding to fail. This tool automatically strips whitespace before attempting to decode. Another common issue is truncated Base64 strings: if the original image was cut off during copying or transmission, the decoded result will be corrupt. The tool validates the decoded data by attempting to load it as an image and will show an error if the image fails to load.

Frequently Asked Questions

Paste the Base64 string or full data URI into the input area. The tool will decode it and show a preview. Click Download to save the image file.
A data URI includes a MIME type prefix: "data:image/png;base64,iVBOR...". A raw Base64 string is just the encoded data without a prefix. This tool accepts both — it detects the data URI prefix automatically, or tries to identify the format from the decoded bytes.
PNG, JPEG, GIF, WebP, SVG, BMP, and any other image format your browser supports. If a data URI is provided, the MIME type is read from the prefix. For raw Base64, the tool reads magic bytes to identify the format.
Valid Base64 contains only A-Z, a-z, 0-9, +, /, and = padding. Common problems are spaces or line breaks (stripped automatically), incorrect padding, or non-Base64 characters. The status bar shows an error if decoding fails.
No. Everything runs in your browser. The Base64 string is decoded using the browser's built-in atob() function and displayed as an image. No data is sent to any server.