Base64 to Image
Base64 to image converter: paste a Base64 string or data:image/png;base64 data URI and get the picture back. Decode Base64 to PNG or Base64 to JPG, then save Base64 as image in one click. Fixing a Base64 image not showing? The page reports the real format and any mismatch in the data URI header.
In WeChat, downloads and image copy may be blocked. If a button does not respond, tap ··· in the top-right corner and choose Open in Browser.
Load Base64 from a text file
You can also drop a .txt or .b64 file anywhere in this tool.
Paste Base64 data to see the decoded image here.
Export image
1200 × 400 pxBase64 to image takes an encoded string or a data:image/...;base64, URI and turns it back into a viewable picture, with the detected format, dimensions and size shown beside the preview, and every byte decoded in your browser tab. The image is never uploaded.
It helps when an API returns a thumbnail as text, when a design handoff arrives as a CSS background rule, or when a chat message contains a data URI instead of an attachment. Paste the value and the decoder on this page sniffs the file signature, renders the picture and lets you save it under the right extension — no guessing whether the payload is a PNG or a JPEG. Nothing is written to disk until you press download.
How to use
- Paste the payload. Paste the Base64 or the full data URI, load a
.txt/.b64file up to 5 MB, or press Sample for a 1×1 PNG. Whitespace is ignored, and a data URI has its header checked before decoding. - Read the preview. The badge shows the detected format, the info line adds pixel dimensions, byte size and character count, and the zoom controls move between 5% and 800% or return to Fit.
- Save or copy. Download image writes the base64 to image result as
image.png,image.jpg,image.svgand so on; Copy image places a PNG version on the clipboard; Open shows the blob in a new tab.
Format sniffing, filenames and previews
The decoder does not trust the label alone; it reads the first bytes and compares them with known image signatures. That is why a broken header produces a clear error instead of a grey box.
Base64 to png and the 89 50 4E 47 signature
A PNG payload begins iVBORw0KGgo in Base64, the encoding of 89 50 4E 47 0D 0A 1A 0A. Decode it and the page labels the image PNG and saves image.png, keeping transparency. A data:image/jpeg, header without ;base64 is rejected with Input is not valid Base64. rather than rendered, because the decoder needs to know that the payload is encoded. The info line also reports the byte size and character count, so a value that claims to be a screenshot but lists 3 KB is obviously incomplete.
Base64 to jpg from a data URI
A JPEG starts FF D8 FF, which appears as /9j/4AAQ at the beginning of the string. A data:image/jpeg;base64, header is accepted, and the download becomes image.jpg. Copy image still produces a PNG on the clipboard, because the clipboard path redraws the pixels through a canvas; the saved file keeps the original JPEG. GIF and WebP follow the same signature rule; only the badge and the extension change.
Save base64 as image without the wrong extension
When the payload has no data URI header, the format comes from the signature alone: GIF8 for GIF, BM for BMP, RIFF plus WEBP for WebP, and a literal <svg for SVG. An unrecognised payload stops with This file type is not supported. The saved name is always generic, so rename image.png to something meaningful before filing it. When the badge shows a format you did not expect, trust the badge: it comes from the bytes, not from the filename or the header.
FAQ
Why is my base64 image not showing?
The payload may be truncated, contain characters outside the alphabet, or hold a non-image file such as a PDF. A base64 to image attempt also fails when a data: header lacks ;base64 or names a type that does not start with image/. Compare the first characters with a known signature.
What does data:image/png;base64, tell the browser?
The prefix declares the MIME type and marks the rest as Base64. data:image/png;base64, says the bytes form a PNG. The decoder checks the declared type on a data URI but still sniffs raw payloads, so a bare base64 to image value works without any prefix at all.
Is the image uploaded when decoding?
No. A base64 to image decode happens in JavaScript on your device, the preview is a local blob URL, and the download is created from memory. Nothing is sent to a server or kept after the tab closes, which makes the page safe for private screenshots.
What is the maximum input size?
Pasted text and .b64 files for a base64 to image decode are limited to 5 MB, which is a little under 3.75 MB of decoded image. Larger strings show “File is too large for browser-side processing.” and should be split or decoded with a command-line tool before previewing.
Why does Copy image produce a PNG?
A base64 to image copy is always PNG because browsers accept PNG most reliably on the clipboard, so the copy path redraws the picture on a canvas and exports PNG. The Download image button keeps the detected format instead, including the original JPEG, GIF, WebP or SVG extension.
Related tools
Image to Base64 Converter runs the same step in reverse and adds resizing, quality and eleven output wrappers for the encoded string. Base64 to PDF checks a document signature and previews pages rather than pixels. PDF to Base64 Converter handles the opposite direction for documents. A base64 to image value produced on either media page opens here without edits, because both pages apply the same signature checks and download the file in a single click.