ToolDash
Base64 to Image Decoder

Base64 to Image Converter

Paste Base64 image data, with or without the data: prefix, and this Base64 image viewer shows the picture straight away. The tool works out the real file type from its bytes and downloads it with the right extension.

  • Free, no sign-up
  • Runs in your browser — nothing is uploaded
  • Instant results, no waiting on a server

Paste raw Base64 or a full data:image/…;base64, URI. The image appears as soon as the data decodes, and its real format is read from the bytes, not the label.

Base64 input

0 chars

Image

The decoded image will appear here.

How to convert Base64 to an image

  1. 1Paste your data into the Base64 input box. Raw Base64, a full data:image/...;base64, URI, or an <img> tag or CSS url() that contains one all work, and line breaks are ignored.
  2. 2The image appears in the preview as soon as the data decodes. A checkerboard behind it shows any transparent areas.
  3. 3Check the Format, pixel Size and File size under the preview. If the data URI's label disagrees with the actual bytes, a note tells you which format was really found.
  4. 4Click Download to save the file with the matching extension, use Download as .png to convert a JPG, WebP, GIF, BMP, ICO or AVIF to PNG, or copy a clean data URI.

Reading images stored as Base64

Base64 turns binary data into plain text using 64 safe characters, so an image can travel inside JSON, HTML, CSS, XML or an email. Every 3 bytes become 4 characters, which makes the text about 33% larger than the file. You'll find Base64 images in API responses (image generation and OCR APIs often return them in a JSON field), in the output of canvas.toDataURL(), in inlined CSS and HTML assets, in email attachments, and in database columns.

A data URI wraps Base64 with its media type: data:image/png;base64, followed by the encoded bytes. The label is only a claim, though, and it's often wrong when strings are built by hand. This tool ignores the label for detection and reads the file signature, the first few bytes that identify a format. They're visible even in the encoded text: PNG data starts with iVBORw0KGgo, JPEG with /9j/, GIF with R0lGOD, WebP with UklGR, and an SVG with PHN2Zy or PD94bWw (the encodings of <svg and <?xml).

Most failures come from damaged strings. A string copied from a log or a truncated database field may be cut short, so the image is missing its end and won't render. Characters outside the Base64 alphabet, a second data: prefix, or quotes from surrounding code also break decoding; the tool strips the common wrappers for you and tells you which character it couldn't read. If the data passed through a URL query string, any + may have been turned into a space, and you'll need to put them back. URL-safe Base64, which uses - and _ in place of + and /, and missing = padding are both handled automatically.

Decoding happens entirely in your browser. That matters because Base64 images pulled from production logs or API responses can contain screenshots, scanned documents or other private material, and nothing you paste here is uploaded. Going the other way, the Image to Base64 tool turns a file back into a data URI.

When you need to decode a Base64 image

Debugging API responses

Decode Base64 image data from a JSON field returned by an image generation, OCR, signature or barcode API.

Extracting inlined assets

Go from data URI to image file: pull an icon or background out of a CSS file, HTML email or SVG.

Checking canvas output

Paste the result of canvas.toDataURL() to confirm what your drawing code actually produced.

Recovering stored images

Turn Base64 from a database column, config file or log line back into a viewable image.

Frequently asked questions

Do I need to include the data:image/png;base64, prefix?

+

No. Paste raw Base64 or a full data URI; both work. Without a prefix, the format is detected from the decoded bytes.

Which image formats can it decode?

+

PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF. Whether AVIF previews depends on your browser; all current major browsers support it.

Why does it say my Base64 isn't an image?

+

The decoded bytes don't start with a known image signature. The data may be truncated, double-encoded, or a different file type such as a PDF, which the error message names when it can.

Can I convert Base64 to PNG or Base64 to JPG?

+

Download keeps the original format, so PNG data saves as .png and JPEG data as .jpg. For WebP, GIF, BMP, ICO or AVIF data, use Download as .png to re-encode it as a PNG in your browser.

Is my data sent to a server?

+

No. Decoding, previewing and downloading all happen locally in your browser, so the image never leaves your device.