Base64 to Image Converter — Decode and Download
Paste a Base64 string or a full data:image/... URI and the picture appears right away. The tool detects the real format from the decoded bytes — PNG, JPG, GIF, WebP, AVIF, BMP, ICO, or SVG — and lets you save it, optionally re-encoded as PNG or JPG. Nothing is uploaded; the decoding happens in your browser tab.
Spotting the image format from the first Base64 characters
Base64 rewrites every 3 bytes as 4 printable characters, so the string runs about 33% longer than the file it carries. Each format opens with fixed magic bytes, and they always encode to the same leading characters. Reading the opening characters reveals the format before anything is decoded.
| String begins with | Format |
|---|---|
| iVBORw0KGgo | PNG |
| /9j/ | JPEG |
| R0lGOD | GIF |
| UklGR | WebP (RIFF container) |
| PHN2Zw or PD94bWw | SVG, i.e. plain-text <svg or <?xml |
When an inline Base64 image costs more than a file
A data URI saves one HTTP request, but the price rises with size. A 200 KB photo turns into roughly 267 KB of text inside the HTML or CSS, downloaded by every visitor. That text is cached only together with the file around it, and a browser cannot lazy-load an image already sitting in the markup. Icons of a few hundred bytes are sensible to inline; above about 2 KB a separate file usually wins.
Frequently asked questions
- Do I need the data:image prefix?
- No. Paste the raw Base64 payload and the tool identifies the format from the decoded magic bytes, then builds the correct data URI for you. If you do include a prefix, it is parsed and used as a fallback hint. A CSS url(...) wrapper and surrounding quotes are stripped.
- Why does my string fail to decode?
- The usual culprits are a truncated copy, HTML entities like + instead of +, or leftover markup. The tool tells you when it finds a character outside the Base64 alphabet so you can spot the damage.
- Can I convert a Base64 PNG to JPG?
- Yes. Pick JPG in the download row and the image is redrawn onto a canvas with a white background, then encoded at quality 0.92. JPEG has no alpha channel, so without that white fill the transparent areas would turn black.