Base64 to Image Decoder
Paste a Base64 string or a full data URI and get the image back — previewed in place and ready to download, with the prefix handled for you.
Click to upload image
Supports JPG, PNG, WebP, GIF
How it works
A compact workflow from input to download.
Switch to decode
Select the decode mode in the tool below. It accepts a raw Base64 string or a complete data URI.
Paste your string
Paste the value, with or without the data:image/png;base64, prefix — the tool detects and handles both forms.
Preview and download
The decoded image renders immediately so you can confirm it is correct, then save it as a real image file.
Tool details
Practical capabilities and safeguards built into this workflow.
Handles the data URI prefix
Strings copied from CSS, JSON, or a browser inspector usually carry a data:image/...;base64, prefix. Paste it as-is and it is stripped for you.
Preview before you save
The image renders in place, so you can confirm you pasted the right string rather than downloading a file to find out.
Nothing is transmitted
Base64 payloads from an API response or a log file often contain confidential data. Decoding runs locally, so nothing is sent anywhere.
Encodes as well as decodes
The same tool converts an image file into a Base64 string when you need to go the other direction.
Clear errors on bad input
Truncated or corrupted strings are reported rather than silently producing a broken file.
No signup or limits
No account, no character cap, and no watermark on the decoded image.
Frequently asked questions
How do I convert a Base64 string back to an image?
What is a data URI and do I need to remove the prefix?
Why does my Base64 string fail to decode?
How can I tell what image format a Base64 string holds?
Does Base64 make files larger?
Is my Base64 string sent to a server?
When should I embed images as Base64 rather than link them?
Understanding Base64 Encoded Images
Base64 is a way of representing binary data using only 64 printable ASCII characters. It exists because many systems — email bodies, JSON payloads, CSS files, XML documents — were designed to carry text and will corrupt raw binary bytes. Encoding an image as Base64 lets it travel safely through those channels as an ordinary string, at the cost of making it about a third larger.
How the encoding works, and why it grows by a third
Base64 takes three bytes of input, treats them as 24 bits, splits that into four groups of six bits, and maps each group to one of 64 characters. Three bytes in, four characters out — a 4:3 expansion, hence the roughly 33% overhead. Where the input length is not divisible by three, one or two = characters are appended as padding. This is also why a valid Base64 string's length is almost always a multiple of four.
Recognising formats from the first few characters
Because the encoding is deterministic, each image format produces a recognisable prefix. A string starting iVBORw0KGgo is a PNG, since that encodes the PNG magic number. One starting /9j/ is a JPEG. R0lGOD indicates GIF, and UklGR indicates a WebP RIFF container. This is a genuinely useful debugging shortcut when an API returns an untyped blob and you need to know what you are dealing with.
When embedding is worth the overhead
Inlining an image as a data URI removes one HTTP request, which used to be a meaningful win. Under HTTP/2 and HTTP/3, requests are multiplexed over a single connection and are far cheaper, so the calculation has shifted. Inlined images also cannot be cached separately — change one byte of your CSS and the browser re-downloads every image embedded in it. The practical guidance is to inline only assets of a few kilobytes, and keep everything else as a linked file.
Common failure modes when decoding
Most decode failures are transport problems rather than encoding problems. Copying from a terminal that hard-wraps lines injects newlines. Copying from a truncated log gives you a partial string. URL-safe Base64 substitutes - for + and _ for /, which a strict decoder rejects. And a string that decodes but renders as nothing is often not an image at all — it may be a PDF or an SVG. Previewing before downloading, as this tool does, catches all of these quickly. To go the other way, use the image to Base64 encoder.
Related tools
Continue the workflow with adjacent tools.