Base64 to Image
Decode a Base64 image or data URI back into a file. Paste the string, preview, download. The inverse of our image-to-Base64 tool.
🔒 Everything happens in your browser — no upload, no server, no tracking.
No image yet.
What is this for?
This tool decodes Base64-encoded images back into viewable, downloadable files. It's the inverse of the image-to-Base64 encoder: paste a data: URI (or raw Base64 payload) and recover the original image. The decoder runs entirely in your browser, auto-detects the image format from MIME type or file signatures, and supports PNG, JPG, WebP, GIF, and SVG.
When to use it
- You've copied a
data:image/…;base64,…URI out of CSS, HTML, or a Markdown file and need the original image file back. - An API response or JWT token contains a Base64 payload and you want to verify what image it actually encodes.
- Debugging a Base64 image that fails to render — round-trip it here to confirm the payload is valid and the format is supported.
- Extracting embedded assets from a single-file HTML demo, self-contained email, or archived web page.
- Converting a Base64 string found in a database export or log file into a viewable image for inspection.
- Testing whether a Base64 payload decodes without errors before using it in production code.
How it works
- Paste the input. Drop either a full
data:image/…;base64,…URI or just the raw Base64 string into the text area. - Decode. The tool uses the browser's
atob()function to convert Base64 bytes. If you provided a data URI, the MIME type is extracted; if raw Base64, the first few bytes are inspected for image signatures (PNG magic bytes, JPEG SOI marker, GIF header, RIFF…WEBP chunk, or SVG XML). - Preview. The decoded bytes are converted to a blob and rendered as an
<img>data URI. You'll see the image immediately if the format is supported and the payload is valid. - Download. Click the download button to save the image with the correct file extension (
.png,.jpg,.gif,.webp, or.svg). If the format can't be detected, it defaults to.bin.
Common gotchas
- Both full URIs and raw Base64 are accepted. Provide
data:image/png;base64,iVBORw0…or justiVBORw0…. Without format hints (raw Base64 of an unrecognisable type), the download gets a.binextension; re-name it or provide the data URI instead. - URL-safe Base64 differs from standard Base64. Standard uses
+ /; URL-safe (used in JWT and some APIs) uses- _. If your payload came from a JWT or URL parameter, replace-with+and_with/before pasting. - Whitespace is stripped automatically. Multi-line Base64 strings with line breaks and spaces will decode correctly — the tool removes all whitespace before decoding.
- A blank preview doesn't always mean failure. If the preview is empty but the decode succeeded with no error message, the bytes are valid Base64 but may not represent a real image, the format may not be supported by your browser, or the file is corrupted. Try downloading anyway — the raw bytes are always saved.
- Very large payloads may be slow. Multi-megabyte Base64 strings will take longer to decode and render. The browser won't crash, but expect a brief pause.