Base64 Converter

Base64 Converter


About the Base64 to Image Converter

Base64 is an encoding that represents arbitrary binary data using only 64 safe text characters (A–Z, a–z, 0–9, + and /, with = as padding). Every 3 bytes of input become 4 characters of output, so Base64 text is about 33% larger than the original file — the price paid for being able to embed binary content in JSON, XML, email or HTML, which only carry text safely.

Images are one of the most common things you will find Base64-encoded: inline data: URIs in HTML and CSS, image fields in JSON APIs, screenshots attached to bug reports by automated tests, and signatures or photos stored in database text columns. This tool decodes a Base64 string, shows the image so you can confirm what it is, and lets you save it as a file.

Common uses

  • Seeing what image an API is actually returning in a photo or thumbnail field.
  • Extracting an inline data:image/png;base64,... image from HTML, CSS or an email.
  • Recovering screenshots that a test runner or monitoring tool stored as Base64.
  • Checking images saved in a database column during debugging.

How to use it

  1. Paste the Base64 string into the Base64 String box. If it starts with data:image/...;base64,, delete that prefix first.
  2. Make sure Format is set to Image (PNG), then press Convert.
  3. The decoded image is previewed on the page; use Save File to download it.

Example

Every PNG file starts with the same eight-byte signature, so a Base64-encoded PNG always begins the same way:

Input
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Output
Paste only: iVBORw0KGgoAAAANSUhEUgAA...
→ previewed as an image and saved as output.png

Tips and common pitfalls

  • Recognise formats by their first characters: iVBORw0KGgo is PNG, /9j/ is JPEG, R0lGOD is GIF and UklGR is WebP.
  • Inline data: URIs are great for tiny icons, but larger images are better served as normal files — they can be cached separately and do not bloat your HTML or CSS.
  • Line breaks inside the Base64 text (common in email and PEM-style output) are usually harmless, but stray spaces or quotes are not.
  • If the preview is blank or broken, the data may be a different image type or may have been truncated when it was copied.

Frequently asked questions

Is my image uploaded anywhere?

The Base64 text is sent to the server only to decode it and return the result in your browser. It is not stored or shared.

How do I convert an image to Base64?

In a browser you can use FileReader.readAsDataURL(); on the command line, base64 image.png (Linux/macOS) or [Convert]::ToBase64String([IO.File]::ReadAllBytes('image.png')) in PowerShell.

Why does decoding fail with "not a valid Base-64 string"?

Usually because the input contains something other than pure Base64: a data:...;base64, prefix, surrounding quotes from a JSON value, or URL-safe characters (- and _ instead of + and /). Remove the prefix and quotes, and convert URL-safe characters back, then try again.

Is Base64 a form of encryption?

No. Base64 is an encoding, not encryption — anyone can decode it instantly and no key is involved. Never rely on Base64 to hide passwords, tokens or personal data.

Related