EncodingFreeNo uploadNo sign-up
Base64 to Image Converter
Paste a Base64 string or data URI, see the image instantly and download it with the right file extension.
Runs in your browser. Your data is never sent to a server.
How to use the Base64 to Image
Paste the Base64
Paste a full data URI or just the Base64 part. Line breaks and spaces are ignored.
Preview the image
The image appears with its format, pixel size and file size. The format is detected from the data itself.
Download it
Save the image with the correct extension, or convert it to PNG or JPG while you are here.
Why use this tool
Base64 images turn up in API responses, database fields, HTML source, CSS files, logs and browser developer tools. Decoding them by hand is slow, and saving the wrong extension makes the file unopenable.
This tool decodes the string in your browser, reads the first bytes to detect whether it is a PNG, JPEG, GIF, WebP, BMP, ICO or SVG, shows a preview and lets you download the image with the right name. A missing data: prefix or URL-safe characters are handled automatically.
Frequently asked questions
How do I convert Base64 to an image?
Paste the Base64 string or data URI into the box. The image appears immediately and you can download it.
Do I need the data:image prefix?
No. Paste just the Base64 characters; the image type is detected from the data.
How do I decode a Base64 image in JavaScript?
Set it as an image source: img.src = "data:image/png;base64," + b64. To get a file, use fetch(dataUri).then(r => r.blob()).
How do I save a Base64 image in Python?
open("image.png", "wb").write(base64.b64decode(b64)). Strip any data:…;base64, prefix first.
Are my files uploaded to a server?
No. formatmath converts files with code that runs inside your browser. Your files are never uploaded, stored or seen by us.
Is it free?
Yes. There is no watermark and no daily limit. An account is optional and only keeps a history of your conversions.