Free · processed in your browser · free account to download
Convert Base64 to an Image
Paste raw Base64 text or a `data:image/...;base64,` URL to preview the picture and download the exact PNG, JPG, GIF, WebP, AVIF, SVG or BMP file (up to 10 MB). Decoding runs in your browser, so the pasted text is not uploaded.
How do I convert a Base64 string back into an image file?
Paste your raw Base64 text or `data:image/...;base64,...` URL into the box above and press Decode to image. The browser strips whitespace, normalizes URL-safe characters, decodes the bytes (up to 10 MB), detects the true file format from the binary header, and shows a preview. Sign in to a free HeyDreaming account to download `decoded.<ext>` with the original bytes untouched.
How it works
01
Paste Base64 or a data URL
Paste a `data:image/...;base64,` URL or raw Base64 text into the box. Line breaks, spaces, URL-safe `-` and `_` characters, and missing `=` padding are cleaned up automatically.
02
Press Decode to image
Click Decode to image. The tool decodes payloads up to 10 MB and inspects the file header to identify PNG, JPG, GIF, WebP, AVIF, SVG or BMP bytes.
03
Preview and download
Check the image preview, detected MIME type and byte size, then click Download to save `decoded.png`, `decoded.jpg` or the matching file extension. The preview needs no account; saving needs a free one.
How the decoder cleans input and sniffs the image format
Real-world Base64 strings arrive in several forms: complete `data:image/png;base64,...` URLs, multi-line MIME blocks with line breaks, or URL-safe Base64 using `-` and `_` instead of `+` and `/` with the trailing `=` signs stripped. The parser accepts all of those, strips whitespace, restores standard Base64 padding, and converts the text back into a raw byte array.
Rather than trusting the MIME type written in a data URL header, the tool checks the magic bytes at the start of the decoded payload for PNG, JPEG, GIF, WebP, AVIF, BMP and XML/SVG signatures. If a header claims `image/png` but the bytes are actually a JPEG, the page notes the mismatch and saves the file with its real `.jpg` extension.
Byte-exact download with no canvas re-compression
Because the downloaded file is built directly from the decoded bytes without passing through a browser canvas, zero generation loss occurs. Animated GIFs keep all their frames, SVGs stay editable vector XML, and any color profiles or EXIF metadata embedded in the Base64 payload remain intact, up to the 10 MB decoded size limit.
If you need the decoded image in a different format—for example, turning a decoded WebP or AVIF into a JPG—download the original file here first and then drop it into Image Converter.
What this tool does not do
It does not decode non-image binary files (such as PDFs, ZIP archives or audio), decode non-Base64 data URLs (such as plain URL-encoded SVG strings without `;base64,`), or re-encode the image into a different format.
Keep exploring
Related free tools
Questions
Base64 to Image: FAQ
Is the Base64 text I paste sent to a server?
No. Parsing, byte decoding and file creation all happen inside your browser, so your data stays on your device. The page logs usage events in Google Analytics, such as which tool ran and the character length, but never the Base64 content or image.
Do I need the data:image/png;base64, prefix?
No. You can paste either a full data URL or just the raw Base64 characters. The tool detects the image format directly from the decoded file header.
Does it accept URL-safe Base64 or multi-line text?
Yes. Spaces and line breaks are ignored, URL-safe `-` and `_` characters are converted to `+` and `/`, and missing `=` padding is added automatically.
Why did it say the bytes are not a recognized image?
The Base64 text decoded into valid bytes, but those bytes did not start with a PNG, JPG, GIF, WebP, AVIF, SVG or BMP file signature. Check that the string was not truncated when copied or that it does not encode a different file type such as a PDF or JSON.
Does decoding change the image quality?
No. The download writes the exact binary bytes encoded in the Base64 string without re-encoding them on a canvas.