Base64 to Image Converter

Turn a Base64 string or data URL back into an image you can see and download.

About Base64 to Image Converter

Paste a Base64 string or a data URL to see the image it holds, check its type and size, and download it as a PNG, JPEG, GIF, WebP or SVG file.

How to use

  1. Paste the Base64 text. Either a full data URL (data:image/png;base64,iVBORw0KGgo…) or the bare Base64 after the comma works, and spaces and line breaks are ignored.
  2. The image appears in the preview, with its detected type and its size in bytes.
  3. Press Download to save it. The file gets the extension that matches the detected type.

The page opens on Decode. Switch to Encode to turn an image file into Base64 instead.

How the image type is found

The type is read from the first bytes of the decoded data, not from the label in the data URL, so a JPEG marked data:image/png is still saved as .jpg. PNG, JPEG, GIF, WebP, BMP, ICO, AVIF and SVG are recognised. If the bytes match none of them, the type named in the data URL is used; if there is none, the data is reported as not an image.

Limits

  • Up to 5 MB of image data, which is about 6.7 million Base64 characters.
  • Standard Base64 only: A–Z, a–z, 0–9, + and /, with optional = padding. URL-safe Base64 uses - and _ instead; replace them with + and / before pasting.
  • Percent-encoded data URLs (no ;base64), which some SVG tools produce, are not decoded.
  • Leave out anything around the string, such as JSON quotes or url(…).

Example

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
→ image/png · 70 B · image.png (a single pixel)

Privacy

Decoding uses the browser's own atob. The text never leaves the page, no request is made, and nothing is stored, so it is safe for screenshots or documents taken from an API response.

Frequently asked questions

How can I tell what kind of image a Base64 string is?
Look at how it starts. PNG data begins iVBORw0KGgo, JPEG begins /9j/, GIF begins R0lGOD, WebP begins UklGR, and SVG usually begins PHN2Zy or PD94bWw. Those are the Base64 forms of each format's fixed first bytes, which is also how this page detects the type.
Why will my Base64 string not decode to an image?
The usual causes are a string cut short when copying, quotes or other text left around it, URL-safe characters (- and _) in place of + and /, or data that is valid Base64 but is not an image, such as a PDF or JSON. The error message says which of these the page ran into.
What is the difference between a data URL and a Base64 string?
A data URL is a Base64 string with a header in front: data:, the media type, ;base64 and a comma, as in data:image/png;base64,iVBOR…. The part after the comma is the image itself. Browsers need the full data URL in src or url(); most APIs send only the Base64 part.
How do I decode a Base64 image on the command line?
On Linux, base64 -d image.txt > image.png. On macOS, base64 -D -i image.txt -o image.png. Remove the data:image/…;base64, header first if the text is a data URL, since the header is not Base64.