Skip to content
ToolPlankDEV
Image & SVG Tools
100% In-Browser Execution

Updated:

Convert Base64 to Image Online

Paste Base64 text or a data URI and convert Base64 to image in your browser. The picture shows right away with its type, size and dimensions, and you can download it as a file. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use Base64 to Image

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste the Base64 text

    Paste the text into the Base64 text box, or press Paste to read it from the clipboard. You can paste bare Base64, a full data URI, or a piece of CSS, HTML or Markdown that contains one. Sample loads a tiny PNG so you can see how it works.

  2. 02

    Look at the picture

    The decoded image appears on the right as soon as the text is valid. Under it you see the file type, the size in bytes and the width and height in pixels. If the text had problems that the tool could fix, such as missing padding, they are listed.

  3. 03

    Download or copy

    Press Download image to save the file with the right extension, such as image.png or image.jpg. Copy data URI puts a clean data URI on your clipboard, ready for an img tag or a style sheet.

How to Convert Base64 to Image

To convert Base64 to image, paste the encoded text into the left box. The tool removes any data URI prefix, decodes the characters back into bytes, works out what kind of image those bytes are and draws it on the right. A tiny PNG, for example, is this much text:

Text
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGNg+M/A8B8ABQACAam5sAAAAABJRU5ErkJggg==

Pasted into the tool, it is recognised as a PNG of 70 bytes. Everything happens on your device, so it works for private images too.

What You Can Paste

The tool accepts the forms that Base64 images usually come in, so you do not have to trim them by hand:

  • Bare Base64, such as the string above.
  • A data URI: data:image/png;base64,iVBORw0KGgo....
  • A CSS rule such as background-image: url("data:image/png;base64,...");. The tool finds the data URI inside it.
  • An HTML tag such as <img src="data:image/png;base64,..."> or a Markdown image.
  • Text with line breaks or spaces in it, which is common when Base64 comes from an email or a certificate-style file.
  • URL-safe Base64, which uses - and _ instead of + and /, with or without the = padding.

When the tool changes anything to make the text readable, it tells you under the picture, so you know what was fixed.

How the Tool Knows the Image Type

A data URI says what the image is, for example image/png, but that label is just text and can be wrong. This tool looks at the first bytes of the decoded data instead. A PNG always starts with the same eight bytes, which is why Base64 PNGs begin with iVBORw0KGgo. JPEG, GIF, WebP, AVIF, BMP and ICO files have their own signatures, and SVG is recognised by its opening tag.

If the label and the data disagree, the data wins. The tool shows a note, and the downloaded file gets the extension that matches what is really inside. When the first bytes are not a known image format, the tool falls back to the type in the data URI, if there is one, and otherwise refuses.

Common Errors and What They Mean

  • Not a valid length: Base64 text cannot have a length that leaves one character over when divided by four. This almost always means the text was cut off when it was copied.
  • A character that is not Base64: letters, digits, plus, slash and equals are allowed. A stray quote, comma or other symbol breaks it. The error shows the character and its position.
  • An equals sign in the middle: the padding sign can only be at the end.
  • Valid Base64, but not an image: the text decodes fine, yet the result is not a known image format. It may be plain text, a PDF or a zip file. For a PDF, use Base64 to PDF. For plain text, use Base64 Decode.
  • The browser could not draw it: the bytes start like an image but the rest is missing or damaged. Copy the full string again.

Base64 to PNG, JPG, GIF, WebP or SVG

The tool does not convert between formats. A Base64 PNG gives you a PNG file, and a Base64 JPEG gives you a JPG file. That keeps the image exactly as it was encoded, with no loss of quality. If you need another format afterwards, an SVG can be turned into a PNG with SVG to PNG.

Large images produce very long text. The tool accepts up to about 6 MB of image data. If a huge string makes your editor slow, copying it straight from the source into this tool is usually easier than opening it in a text editor first.

Go the Other Way: Image to Base64

To turn a file into Base64, use Image to Base64. It gives you a data URI or a CSS, HTML or Markdown snippet and shows how much larger the text is than the file. Pictures from a phone or camera can carry location details, so you can check them first with the EXIF Remover.

Safety When You Open Unknown Base64

The preview is shown as a plain image, so scripts inside an SVG are not run. Still, think about where the text came from. An image can be offensive or misleading, and the tool only decodes and displays it. It does not check whether an image is safe or genuine.

Your Text Stays in Your Browser

Decoding is done by code running in your browser tab. The text and the image are not sent to a server and are not stored. Reloading the page removes them. See the Privacy Policy for details.

Frequently Asked Questions

Technical Q&A for Base64 to Image

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the Base64 text or data URI into the left box. The picture appears on the right, and Download image saves it as a file.

Yes, this is one. The decoded picture is shown straight away with its type, size in bytes and dimensions in pixels, so you can check what the text contains before saving it.

Paste the Base64 of a PNG and press Download image. The file is saved as image.png. The tool saves the same format the text contains and does not re-encode it.

Paste the whole data URI, including the data:image/png;base64, part. The tool removes the prefix, decodes the rest and shows the image.

Yes. The tool looks for a data URI inside the text and uses only the Base64 part, so you can paste a whole img tag, a CSS rule or a Markdown image.

The text is most likely cut off. Base64 comes in groups of four characters, and a single leftover character is not possible. Copy the full string again.

The Base64 is valid, but it decodes to something that is not a known image format, such as plain text or a PDF. Use Base64 Decode for text.

Yes. Text that uses - and _ instead of + and / is read as URL-safe Base64, and missing = padding is added back.

PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG. Whether the preview shows depends on your browser, because the browser draws the image.

No. Decoding runs in your browser and nothing is sent to a server or saved. Reloading the page clears it.