Toolerax logoToolerax

Base64 to Image

Decode Base64 into a viewable image.

100% private — runs in your browser, nothing is uploaded.

Decoding happens entirely in your browser — the data never leaves your device.

How to use the Base64 to Image

  1. 1
    Paste the Base64

    With or without the data URI prefix — whitespace is fine.

  2. 2
    Check the preview

    The decoded image renders with its detected format and size.

  3. 3
    Download it

    Save the image with the correct file extension.

Examples

InputOutput
iVBORw0KGgo…detected image/png
data:image/jpeg;base64,/9j/4AAQ…detected image/jpeg

Decode Base64 back into a real image

This Base64 to image converter takes an encoded string — from an API response, a CSS file, an email source or a database dump — and turns it back into a viewable, downloadable image. It accepts raw Base64 or a full data:image/…;base64,URI, strips stray whitespace, validates the encoding and identifies the format automatically from the file's signature bytes.

Debugging embedded images

Base64-embedded images are everywhere: inline images in HTML emails, icons embedded in stylesheets, screenshots in JSON payloads, blobs stored in databases. When something renders wrong, pasting the string here answers the first debugging question — is the data itself a valid image? — and shows exactly what the bytes contain, including the true format when a wrong MIME type is declared.

Private by design

Decoding uses the browser's built-in functions, so potentially sensitive screenshots or documents never leave your machine. Need the opposite direction? The image to Base64 tool encodes files into data URIs, and the Base64 encoder/decoder handles plain text.


How to convert Base64 to an image

Sooner or later every developer stares at a wall of iVBORw0KGgoAAAANSUhEUg… wondering what image is trapped inside. Base64 is how binary images travel through text-only channels — JSON APIs, CSS files, HTML emails, database columns — and decoding it back is a ten-second job when you know the shape of the data.

The anatomy of an embedded image

A full data URI has three parts:

data:image/png;base64,iVBORw0KGgo…

— the scheme, the declared MIME type, and the Base64 payload. But you'll often meet the payload alone, stripped of its prefix. That's fine: the image format is identifiable from the data itself.

Magic bytes: reading the format from the string

Every image format begins with signature bytes, and Base64 encodes them into recognizable prefixes:

  • iVBOR → PNG
  • /9j/ → JPEG
  • R0lGO → GIF
  • UklGR → WebP
  • PHN2Z → SVG (it's the text “<svg”)

This is also a debugging superpower: when a server claims image/png but the payload starts with /9j/, you've found your bug — it's a JPEG with the wrong label.

The five classic decoding failures

  • Whitespace inside the string — line breaks from copy-pasting out of logs or emails. Strip all whitespace first.
  • Truncation — the copy missed the end. Base64 length should be a multiple of 4; a wrong remainder means missing data.
  • URL-safe variant — - and _ instead of + and /. Swap them back before decoding.
  • Double encoding — decoding yields another Base64 string instead of binary. Decode again.
  • Missing padding — strict decoders demand trailing =; add until the length divides by 4.

Size expectations

Base64 inflates data by ~33% — every 3 bytes become 4 characters. A 30 KB image is a ~40 KB string. If your “image” string is 200 characters long, it's an icon at best; if a JSON response feels bloated, embedded Base64 images are the usual suspect.

Next steps

Going the other way? Use the image to Base64 tool to build data URIs, or the Base64 encoder/decoder for plain text payloads.

Frequently Asked Questions

How do I convert Base64 to an image?

Paste the Base64 string into the box — with or without the data:image/...;base64, prefix. The tool validates it, detects the format from the file's magic bytes, previews the image and offers a download.

How does the tool know whether it's a PNG or JPG?

Every image format starts with signature bytes that survive Base64 encoding as a recognizable prefix: iVBOR means PNG, /9j/ means JPEG, R0lGO is GIF, UklGR is WebP. If a data URI prefix is present, its declared type is used instead.

Why does my Base64 string fail to decode?

Common causes: line breaks or spaces inside the string (this tool strips them automatically), missing padding (=), URL-safe Base64 (- and _ instead of + and /), or a string that was truncated when copied.

What image formats are supported?

PNG, JPEG, GIF, WebP, SVG, BMP and ICO — detected automatically and downloadable with the right file extension.

Is it safe to paste sensitive images here?

Yes. The decoding runs entirely in your browser with JavaScript's built-in atob — the Base64 data is never uploaded to any server.

How do I do the reverse — image to Base64?

Use our Image to Base64 tool, which encodes any image file into a Base64 data URI ready for CSS or HTML.

Why is a Base64 image string larger than the original file?

Base64 turns every 3 bytes into 4 ASCII characters, adding roughly 33% overhead. A 30 KB image becomes about a 40 KB Base64 string.

Related tools