DevSwitch.net

Resetting tool...

Back to Tools
b64

Base64 Decode Image

Decode Base64 strings back to images

Image Tools

Paste a Base64 string or data URI (data:image/...;base64,...). Images are processed in your browser - nothing is uploaded to any server.

Turn a Base64 string into an image

Paste a Base64 string or a whole data URI and press Decode Image, or Ctrl+Enter in the box. The decoder shows the picture with its format, size in pixels and approximate file size, and Download Image saves it as a file.

Copy Image puts the picture on the clipboard, ready to paste into a chat, a document or an image editor. Browsers copy PNG images reliably; for other formats, use Download Image.

Need the string from an image file?

The encoder turns any image into a Base64 string and a data URI, and shows how much bigger the text is.

How the image format is detected

A data URI names its type, so the decoder uses it as it is. For a raw string it looks at the first characters, which are the file's signature in Base64:

String starts withFormatSaved as
iVBORw0KGgo PNG decoded-image.png
/9j/ JPEG decoded-image.jpg
R0lGOD GIF decoded-image.gif
UklGR WebP decoded-image.webp
PHN2Zy SVG decoded-image.svg

Anything else is tried as PNG. An SVG file that starts with an XML declaration begins with PD94bWwg instead and isn't recognised: paste it as a data URI starting with data:image/svg+xml;base64,.

When a Base64 image won't decode

Most failures come from how the string was copied, not from the image:

  • Problem

    Copied from JSON, the string contains \/

    Fix

    JSON may escape every slash. Replace \/ with / before pasting.

  • Problem

    The string uses - and _

    Fix

    That is URL-safe Base64, used in tokens and URLs. Swap - for + and _ for /.

  • Problem

    Only part of the string was copied

    Fix

    Long strings get cut off in logs, terminals and chat previews. Copy the whole value again from the source file.

  • Problem

    The data is not an image

    Fix

    Base64 of text, a PDF or a font decodes to bytes the browser can't show as a picture, and the decoder says the input is invalid.

Base64 to image questions

decoded-image with the extension of the detected format, such as decoded-image.png. Rename the file after saving.

About three quarters of the Base64 length, because 4 characters hold 3 bytes. The size under the preview is that estimate, marked with ~.

No. Browsers skip spaces and line breaks inside Base64 data, so a string wrapped at 76 characters, as in email, decodes as it is.

No, one string at a time. Decode Another clears the box for the next one.

No. Decoding happens in your browser, and the image never leaves your device.