Skip to main content

Developer

Base64 to image decoder

Paste a Base64 string (with or without the `data:image/...;base64,` prefix) and download the decoded image. Everything happens in your browser.

Written by · Published · Last updated

Runs in your browserPrivate by design

Common uses

  • Recover an image stored as a Base64 string in JSON or YAML
  • Inspect an inlined data URL pulled from a CSS or HTML file
  • Save an attachment delivered in a Base64 API response

Turning a Base64 string back into a file

This tool does the reverse of encoding: paste a Base64 string and it reconstructs the original image, shows a preview, and lets you download it as a real file. It is the quick way to recover an image that has been stored or transmitted as text: pulled from a JSON field, a YAML config, a database column, an API response, or an inlined data URL in someone else's HTML or CSS.

You can paste the string with or without the data:image/…;base64, prefix. With the prefix, the tool takes the image type from it. Without one, it reads the first decoded bytes to recognize PNG, JPEG, GIF, WebP, BMP, ICO or SVG, and names the download to match, for example formatos-decoded.png or formatos-decoded.jpg. If the bytes match none of these, it falls back to PNG. The file is saved exactly as decoded, in its original format; nothing is re-encoded.

Whitespace and line breaks in the pasted text are ignored, and a raw string in URL-safe Base64, which uses - and _ in place of + and /, is converted automatically. What matters is that the actual Base64 characters are complete and unaltered.

Why decoding sometimes fails

Decoding only works if the string is valid, complete Base64. The most common failure is a truncated copy: a long data URL that got cut off when it was stored or pasted will not decode, or will decode to a broken image. Copy the entire string from the very first character to the last, with nothing trimmed.

Other causes are corruption and escaping. If characters were altered or percent-encoded along the way (%2B in place of +, for example), the bytes no longer reconstruct a valid image, so undo the URL escaping first. And a string that decodes to something other than an image, such as a PDF or a ZIP file, will not preview here at all.

A reminder that mirrors the encoder: Base64 is encoding, not encryption. A string you can decode here, anyone can decode; there is no password and no protection. Treat the contents of any Base64 image as fully readable.

How your data is handled

Decoding runs entirely in your browser. On this site, the pasted string is processed on your own device and is not uploaded to our servers, and nothing is stored after you leave the page, so recovering a private image from a config file or an API response stays on your machine. Review the decoded image before forwarding it, since the source string came from elsewhere.

If you have the opposite need, turning an image file into a Base64 string for inlining or storage, use the Image to Base64 encoder. The two tools are a matched pair: encode to text, decode back to a file.

Frequently asked questions

No, it is optional. If you paste the full data:image/...;base64,... prefix, the tool reads the image type from it and names the download correctly. If you paste only the raw encoded characters, it recognizes PNG, JPEG, GIF, WebP, BMP, ICO and SVG from the decoded bytes, and falls back to PNG for anything else.

The most common cause is a truncated copy; a long string cut off when it was stored or pasted. Copy the entire string from the first character to the last. Corruption, re-wrapping, or URL-escaping along the way can also break decoding.

Whatever the source string encodes, such as PNG, JPG, GIF, WebP or SVG. The file is saved exactly as decoded, not converted. The type comes from the data: prefix when present, and from the decoded bytes when it is not.

Base64 is encoding, not encryption: any string you can decode here, anyone can decode. There is no password protection. Treat the contents as fully readable, and review the image before forwarding it since the string came from elsewhere.

No. Decoding runs entirely in your browser. On this site, the pasted string is processed on your own device and is not uploaded to our servers, and nothing is stored once you close or reload the page.

Related tools