Free Base64 to Image Decoder
The Base64 to Image Decoder turns a Base64 string back into a viewable image. Paste a data URI or raw Base64, preview it, and download it as a file.
The encoding direction is the Image to Base64 Converter, and documents are handled by the Base64 to PDF Decoder. To move between encodings rather than formats, the Base64 to Hex Converter is the tool.
How to use the Base64 to Image
- 1 Paste a Base64 string into the input box — the bare payload, or a complete data URI starting with `data:image/`.
- 2 Press Decode. The tool sniffs the format from the decoded bytes rather than trusting the label, so a mislabelled string still produces a correct file.
- 3 Check the preview to confirm the right image came back.
- 4 Download it, or right-click the preview to copy the image directly.
Data URIs, and when to unwrap them
A data URI is just a tiny wrapper around the Base64 payload. The `data:` prefix names the MIME type, then `;base64,` marks where the encoded bytes begin. Everything after the comma is the image itself, which is why a decoder can accept either the wrapped or the bare form.
People usually arrive here because something produced a data URI that they need as a normal file — a CSS stylesheet with an inlined icon, a JSON API returning images as strings, or a saved web page where every graphic was inlined. Unwrapping returns an ordinary file you can edit, resize or upload.
- Accepts both `data:image/png;base64,…` and a raw payload.
- Detects JPEG, PNG, GIF, WebP, BMP, ICO and SVG from the byte signature.
- Rejects a string whose length is not a valid multiple of four, rather than guessing.
Frequently asked questions
The string decodes but the browser shows a broken image. What went wrong?
Almost always the string is truncated or has whitespace inserted in the middle. Base64 is position-sensitive: a single missing character shifts every subsequent group and the bytes come out as garbage. Long strings copied out of an email client or a chat window are the usual culprits, because those wrap lines and sometimes strip trailing characters.
How do I know which image format is hiding in the string?
You do not have to. The first decoded bytes carry a signature — \xFF\xD8\xFF for JPEG, \x89PNG for PNG, GIF8 for GIF, and the letters RIFF/WEBP for WebP. The decoder reads those bytes and picks the extension from them, so a string wrongly labelled as PNG but actually holding a JPEG still saves correctly.
What image MIME types and data URI prefixes can be parsed?
The decoder accepts both raw Base64 character strings and full RFC 2397 Data URI schemes including image/png, image/jpeg, image/webp, image/gif, and image/svg+xml. It automatically strips header prefixes like data:image/png;base64, before validating the byte stream against magic numbers to render the correct file extension.
Related Image & Color Tools
You might also need
Tools from other categories that people pair with the Base64 to Image: