Convert Base64 to image

Paste a Base64 string or a data URI and see the image it contains. The tool detects the real file type, shows a preview with its size and lets you download the image as a file. Decoding happens in your browser.

  • Free
  • No sign-up
  • Runs in your browser

Processing…

Runs in your browser — your text is never sent to our servers.

How to use Base64 to Image

  1. Paste your text into the box Base64 text or data URI, or click Try a sample to see how it works.
  2. The image is decoded as you type. Check the preview and the line with the type, size in bytes and pixel size.
  3. If a warning says the declared type differs from the real one, note that the download uses the real type.
  4. Click the Download button to save the image, for example image.png. Click Clear to start again.

Features

  • Accepts a data URI, raw Base64 (standard or URL-safe, with or without padding) and text with line breaks
  • Finds a data URI inside an img tag or a CSS url() snippet
  • Also reads percent-encoded data URIs such as data:image/svg+xml,%3Csvg...
  • Detects PNG, JPEG, GIF, WebP, BMP, AVIF, HEIC, ICO, TIFF and SVG from the first bytes of the data
  • Preview on a checkerboard background, so transparent areas are visible
  • Warns when the type written in the text does not match the real one
  • Decodes up to 25 MB and never uploads the data

Supported formats and limits

  • Maximum input: 35,000,000 characters

Examples

InputResult
A 1 x 1 pixel PNG written as raw Base64: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==Detected PNG, image/png, 70 bytes. The download is image.png.
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7Detected GIF, image/gif, 42 bytes. The download is image.gif. — A data URI whose declared type matches the real type, so no warning appears.

Limitations

  • The decoded data must be an image of a supported type. Other files, such as a PDF written in Base64, are rejected with a message.
  • The limit is 25 MB of decoded data.
  • HEIC and TIFF files may not show a preview in your browser, but they can still be downloaded.
  • The tool does not edit, resize or convert the image. Use the image converter for another format.
  • Text that is not valid Base64 gives an error, and so does a string that decodes to something other than an image.

Learn more

Base64 writes binary data, such as a picture, using only letters, digits and a few symbols, so it can sit inside HTML, CSS, JSON or an email. A data URI wraps it in a small header: data:image/png;base64, followed by the encoded bytes. The header states a media type and the encoding, but it is only a label.

Real image files begin with fixed bytes called magic numbers. A PNG starts with the bytes 89 50 4E 47, a JPEG with FF D8 FF and a GIF with the letters GIF. Reading them is the dependable way to identify a format, which is why this tool trusts the decoded data rather than the text in front of it.

Base64 turns every 3 bytes into 4 characters, so encoded text is about 33 percent larger than the file. Inlining an image this way saves a request, but the browser cannot cache it separately, so it is sensible only for very small images such as icons. The format is defined in RFC 4648 and data URIs in RFC 2397.

Frequently asked questions

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

No. You can paste the complete data URI or only the Base64 characters that come after the comma. The type is found from the image data itself.

Why does the tool say the type differs from the one in my text?

The prefix of a data URI is only a label and can be wrong. The tool reads the first bytes of the data, reports the real type and uses it for the download.

Can I paste an img tag or CSS code?

Yes. If the text contains a data URI, for example in src="..." or url(...), the tool finds it and decodes it.

Is my image uploaded?

No. The text is decoded in your browser and nothing is sent to a server.

Sources

Last reviewed: September 30, 2026