base64image
English

Free online decoder

Base64 to Image Converter

Paste a Base64 string and get the picture back instantly. The format is detected automatically and everything runs in your browser, so your data never leaves this device.

0 charsor drop a .txt file here
Image out

Your image appears here

Nothing is uploaded. Decoding happens on this device.

Format
—
Dimensions
—
File size
—
Base64 length
—

How to convert Base64 to an image

  1. Paste the string

    Drop in raw Base64 or a full data:image/...;base64, URL. Quotes, line breaks and CSS url() wrappers are cleaned up automatically.

  2. See it decode

    The format is read from the file signature, not guessed, and the picture renders at once with its dimensions and size.

  3. Save the image

    Download the original file, re-encode it as PNG, JPG or WebP, or copy it straight to your clipboard.

Built for the way developers work

  • Private by design

    Decoding runs in JavaScript on your device. The string is never sent to a server, so tokens, screenshots and customer data stay with you.

  • Real format detection

    Magic bytes identify PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF even when the data URL prefix is missing or wrong.

  • Forgiving input

    Handles URL-safe Base64, missing = padding, wrapped lines, JSON-escaped strings and surrounding quotes.

  • Exact file details

    Shows pixel dimensions, decoded file size and string length, which is handy when checking API payloads.

  • Format conversion

    Re-encode any decoded picture to PNG, JPG or WebP without leaving the page.

  • No limits, no account

    Free to use with no sign-up, no watermark and no daily quota.

What is a Base64 image?

Base64 is a way of writing binary data using 64 printable characters: A–Z, a–z, 0–9, + and /. It is defined in RFC 4648. Every 3 bytes of the file become 4 characters of text, so a Base64 image is about 33% larger than the original file.

A data URL, defined in RFC 2397, wraps that text with a media type so a browser can render it directly: data:image/png;base64,iVBORw0KGgo.... This is how small images are embedded inside HTML, CSS, JSON API responses, emails and SVG files.

Converting Base64 to an image reverses the process. The text is decoded back to the original bytes and saved as a normal image file, identical to the one that was encoded.

Image formats and their Base64 signatures

The first characters of a Base64 string reveal the image format, because every format starts with fixed signature bytes.

FormatMIME typeBase64 starts withTransparencyAnimationBest for
PNGimage/pngiVBORw0KGgoYesNoLogos, icons, screenshots
JPGimage/jpeg/9j/NoNoPhotographs
GIFimage/gifR0lGODYesYesShort simple animations
WebPimage/webpUklGRYesYesSmaller web images
SVGimage/svg+xmlPHN2ZyYesYesScalable icons and illustrations
BMPimage/bmpQkNoNoUncompressed legacy bitmaps
ICOimage/x-iconAAABAAYesNoFavicons

Decode Base64 to PNG in code

When you need to do the same thing in a script, these snippets write a Base64 string to an image file.

JavaScript
const img = new Image();
img.src = `data:image/png;base64,${b64}`;
document.body.append(img);
Node.js
import { writeFileSync } from 'node:fs';

writeFileSync('image.png', Buffer.from(b64, 'base64'));
Python
import base64

with open("image.png", "wb") as f:
    f.write(base64.b64decode(b64))
Shell
base64 --decode image.txt > image.png

Frequently asked questions

How do I convert Base64 to an image?

Paste the Base64 string or data URL into the input box. The image is decoded and shown immediately, and the Download button saves it as a file. No upload or sign-up is needed.

Is my Base64 data uploaded to a server?

No. Decoding is done by JavaScript inside your browser. The string and the resulting image are never transmitted, which makes the tool safe for private or sensitive pictures.

Which image formats are supported?

PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF. The format is detected from the file signature, so it works even without a data:image/... prefix.

Do I need the data:image prefix?

No. You can paste raw Base64 such as iVBORw0KGgo... or a complete data URL. The converter adds the correct media type for you.

Why does my Base64 string not decode?

The usual causes are a truncated string, characters lost while copying, or data that is not an image at all. A valid PNG starts with iVBORw0KGgo and a JPEG with /9j/.

Is there a size limit?

There is no fixed limit. Strings of tens of megabytes decode fine on a modern computer; the practical ceiling is the memory available to your browser.