ToolNimba Browse

🖼️ Base64 to Image Converter

By ToolNimba Web Dev Team · Updated 2026-06-19

Accepts a full data URI or a bare Base64 string. The data is decoded in your browser and never leaves your device.

Paste a Base64 image string and press Render image.

This Base64 to image converter turns a Base64 string or a full data URI back into a real, viewable image. Paste the text, and the tool decodes it, shows a live preview, works out the image type, and gives you a download link. If only the raw Base64 part is supplied, you can pick or auto-detect the MIME type. Everything runs in your browser, so the data is never uploaded to a server.

What is the Base64 to Image?

Base64 is a way of writing binary data, such as an image file, using only 64 plain text characters (A to Z, a to z, 0 to 9, plus + and /). Because it is text, a Base64 image can be embedded directly inside HTML, CSS, JSON or an email instead of being a separate file. Decoding reverses that: it reads the text back into the original bytes so a browser can display the picture again.

Most Base64 images travel as a data URI, which looks like data:image/png;base64,iVBORw0KGgo… The part before the comma is a header that names the MIME type (here image/png) and says the payload is Base64 encoded. The part after the comma is the actual encoded image. This tool reads that header when it is present, so it knows the exact type without guessing. When you paste only the raw Base64 (no data: prefix), there is no header to read, so the type is inferred from the first few bytes, the magic number, or you can set it yourself.

Decoding happens entirely on your device using the browser's built-in atob function and a Blob, which is then loaded as an image to confirm it is genuinely decodable. Because nothing is sent over the network, even large or private images stay local. The decoded bytes are smaller than the Base64 text that produced them: Base64 inflates data by roughly one third, so a 12 KB data URI corresponds to about 9 KB of real image.

When to use it

  • Recovering an image that a developer or designer pasted to you as a Base64 data URI in a chat, ticket or document.
  • Inspecting a Base64 image embedded in HTML, CSS or JSON to see what it actually looks like before using it.
  • Saving an icon or sprite that a website stores inline as a data URI rather than as a downloadable file.
  • Debugging an API response or SVG that returns image data as a Base64 string and checking it renders correctly.

How to use the Base64 to Image

  1. Paste the Base64 string or the full data:image/…;base64,… URI into the text box.
  2. If you pasted only the raw Base64, leave the MIME type on Auto-detect or pick the correct format.
  3. Press Render image to decode and preview it.
  4. Check the detected type and dimensions, then use the Download button to save the file.

Formula & method

A data URI has the shape: data:[MIME type];base64,[Base64 payload]. Decoding reverses Base64: every 4 Base64 characters map back to 3 raw bytes, so decoded size is about (Base64 length x 3) / 4 bytes, minus any padding (=).

Worked examples

You receive the full data URI data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== and want the PNG.

  1. The header data:image/png;base64 tells the tool the type is image/png and the payload is Base64.
  2. The text after the comma is decoded from Base64 back to the original PNG bytes.
  3. The bytes are wrapped in a Blob of type image/png and loaded to confirm they form a valid image.
  4. A 1 x 1 pixel PNG appears in the preview with a Download button set to image.png.

Result: A valid 1 x 1 px PNG is previewed and ready to download as image.png

You paste only the raw Base64 R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 with no data: prefix.

  1. There is no header, so the MIME type cannot be read from the string.
  2. With Auto-detect on, the first bytes GIF8 are recognised as the GIF magic number.
  3. The type is set to image/gif and the bytes are decoded and previewed.
  4. The download filename is set to image.gif based on the detected type.

Result: The raw Base64 is identified as a GIF and saved as image.gif

Common image MIME types and the magic bytes used to auto-detect them

MIME typeFile extensionLeading bytes (hex)
image/png.png89 50 4E 47
image/jpeg.jpgFF D8 FF
image/gif.gif47 49 46 38 (GIF8)
image/webp.webp52 49 46 46 … 57 45 42 50 (RIFF…WEBP)
image/bmp.bmp42 4D (BM)
image/x-icon.ico00 00 01 00
image/svg+xml.svgtext starting with (less-than)svg or an XML prolog

Common mistakes to avoid

  • Copying only part of the Base64 string. A truncated string decodes to corrupt bytes and will not render, or shows a broken image. Make sure you copy the entire payload, including the trailing = padding if it is there.
  • Including the data: header inside the raw field but breaking it. If you paste a data URI, keep the whole thing intact (data:image/png;base64,…). Pasting the header without the ;base64 marker, or splitting it across lines incorrectly, stops it being recognised.
  • Expecting the type to be guessed for raw Base64. Without a data: header the type can only be sniffed from the bytes. For unusual formats, set the MIME type manually instead of relying on Auto-detect.
  • Confusing Base64 size with image size. The Base64 text is about one third larger than the real image. A long string does not mean a large picture, the decoded byte size shown after rendering is the true file size.

Glossary

Base64
A text encoding that represents binary data using 64 printable characters, letting images travel as plain text.
Data URI
A string of the form data:[MIME type];base64,[payload] that embeds a file inline instead of linking to it.
MIME type
A label like image/png or image/jpeg that tells software what kind of file the data is.
Magic number
The first few bytes of a file that identify its format, used here to auto-detect the image type.
Blob
A browser object holding raw binary data with a type, used to build a downloadable file from the decoded bytes.

Frequently asked questions

How do I convert a Base64 string to an image?

Paste the Base64 string or the full data URI into the box and press Render image. The tool decodes the text, shows a preview, detects the image type, and gives you a download link. It all happens in your browser.

Do I need the data:image part, or just the Base64?

Either works. If you paste a full data URI like data:image/png;base64,…, the type is read from the header. If you paste only the raw Base64, the tool auto-detects the type from the bytes, or you can choose it from the dropdown.

Is my image uploaded anywhere?

No. Decoding uses your browser only, with the built-in atob function and a local Blob. Nothing is sent to a server, so even private or large images stay entirely on your device.

Why does it say the Base64 is invalid?

Valid Base64 uses only A to Z, a to z, 0 to 9, + and /, with optional = padding, and its length must be a multiple of 4. Stray characters, a truncated copy, or missing padding will trigger the error. Recopy the complete string.

Which image formats are supported?

PNG, JPEG, GIF, WebP, BMP, ICO and SVG are all supported. The type is taken from the data URI header, sniffed from the leading bytes, or set manually using the MIME type dropdown.

Can I decode a Base64 SVG?

Yes. Paste the data URI or raw Base64 for the SVG and it will render and download as a .svg file. SVG is detected by spotting an svg tag near the start of the decoded text, or you can select image/svg+xml manually.