Base64 to Image Converter

Turn Base64 strings and data URLs back into viewable, downloadable image files.

Paste Base64 or a data URL

Tip: you can also paste straight into the box with Ctrl/Cmd+V and press Ctrl/Cmd+Enter to decode.

Browser-based decoding

  • →Accepts data URLs and raw Base64 with or without a prefix
  • →File type is detected from the data URL header or image signature
  • →Preview and download happen in the browser

Decoded files up to 25 MB are supported. This is the inverse of Photo2URL's Image to Base64 tool.

How to Convert Base64 Back to an Image

  1. 1

    Paste your input

    Copy a data URL or raw Base64 string and paste it into the box, or use Paste from clipboard.

  2. 2

    Decode instantly

    Press Decode image. The browser validates and decodes the string.

  3. 3

    Check the preview

    Confirm the detected format, file size, and dimensions before downloading.

  4. 4

    Download the image

    Save the decoded bytes as a real image file in its original format.

Why Decode Base64

Base64 text can be decoded and previewed immediately in the page, so you can inspect the image and download it without leaving the tool.

Data URL or raw Base64

Paste a complete data URL or just the raw Base64 text. Whitespace and line breaks are handled automatically.

Automatic format detection

When no MIME type is declared, the tool identifies JPEG, PNG, GIF, WEBP, BMP, SVG, and AVIF from their file signatures.

Runs in the browser

Decoding uses atob(), TextDecoder, and data URLs in this page.

Instant preview

The decoded image renders immediately, with detected format, file size, and pixel dimensions.

Original-format download

Download the exact decoded bytes as a real image file in the detected format — no re-encoding or quality loss.

Clipboard friendly

Paste directly into the box or use the Paste from clipboard button, then decode with one click.

Supported Formats and Limits

Detected formats

PNG, JPG, GIF, WEBP, SVG, BMP, and AVIF (when your browser can render it). Data URLs that declare a non-image type are rejected.

Size limit

Decoded files up to 25 MB are accepted. Base64 text for a 25 MB file is roughly 34 MB, so the tool validates size before allocating decoded bytes.

Troubleshooting Invalid Base64

Most decode errors come from how the string was copied, not from the image itself. If a decoder rejects your input, check these four causes first. This tool normalizes several of them automatically.

The string was truncated

A log viewer, chat message, or HTTP inspector may shorten a long value. Copy the whole field again — a payload missing its middle or end either fails validation or decodes to a broken image.

Escaped slashes or surrounding quotes

JSON often escapes forward slashes as \/ and wraps the value in quotes. This tool removes the escaping and quotes before decoding, and it can extract the value from a whole JSON object.

URL-safe Base64 (- and _)

Tokens and URL-safe encoders replace + with - and / with _. This tool converts them back automatically; other decoders may reject them unless you substitute + and / yourself.

Missing = padding

Base64 length should be a multiple of four; some APIs drop the trailing padding. This tool adds it automatically. If another decoder complains, append = until the length is a multiple of four.

Common API Response Formats You Can Paste

You do not have to extract the Base64 value by hand. Paste the whole JSON response or CSS declaration and the decoder pulls out the image payload before validating it.

OpenAI-style image response

Image generation APIs often nest the payload under data[].b64_json.

{
  "created": 1730000000,
  "data": [
    { "b64_json": "iVBORw0KGgo..." }
  ]
}

Custom REST API

Common field names such as content_base64, image_base64, and base64 are recognized.

{
  "filename": "avatar.png",
  "content_base64": "iVBORw0KGgo..."
}

CSS url() declaration

Paste the rule; the decoder extracts the data URL between the quotes.

.avatar {
  background-image: url("data:image/png;base64,iVBORw0KGgo...");
}

Raw Base64 or data URL

Paste data:image/png;base64,... or the bare string. Whitespace, line breaks, escaped slashes, URL-safe characters, and missing padding are normalized automatically.

The ... in each example stands for the rest of the payload. To see the whole flow without preparing an input, press Try a sample above.

How Your Base64 Input Is Processed

Base64 to Image decodes the pasted string with native browser APIs and renders a data URL for preview. Invalid or non-image data is rejected before you download anything.

To create a hosted public URL, use the Image to URL converter. To encode an image instead of decoding one, use Image to Base64.

Frequently Asked Questions

Is the Base64 to Image converter free?

Yes. Decoding uses native browser APIs with no account requirement. Decoded files up to 25 MB are supported.

How is my Base64 input processed?

The Base64 string is decoded with atob() and rendered as a data URL for preview in this page.

What input formats do you accept?

Complete data URLs, raw Base64 with or without line breaks, JSON responses with a b64_json, content_base64, image_base64, or base64 field, and CSS url() declarations. URL-safe characters and missing = padding are normalized automatically. If no MIME type is declared, the tool detects the format from the image's file signature.

Which image formats can be decoded?

PNG, JPG, GIF, WEBP, SVG, BMP, and AVIF when the browser supports rendering them. Data URLs that declare another non-image MIME type are rejected with a clear message.

What happens if my Base64 is invalid?

The tool validates the Base64 alphabet, padding, and decoded content before showing anything. Invalid strings and decoded data that isn't a recognized image produce an inline error instead of a broken download.

Why does my Base64 string fail to decode?

The most common causes are a truncated value, JSON-escaped slashes (\/), URL-safe characters (- and _), or missing = padding. This tool normalizes escaped slashes, URL-safe characters, and padding automatically; re-copy truncated values in full and make sure any pasted JSON is valid.

Is there a size limit?

Decoded files up to 25 MB are accepted. Larger inputs are rejected before decoding to avoid exhausting browser memory.

What is the difference between raw Base64 and a data URL?

A data URL includes the MIME prefix (data:image/png;base64,…) and can be opened directly in a browser. Raw Base64 is the encoded text after the comma. This tool accepts either one.