Base64 to Image Converter
Decode a Base64 string back into a viewable and downloadable image file directly in your browser.
Base64 to Image Converter tool
Example
Input: A raw Base64 string (no data: prefix) that begins with /9j/, copied from an 800 x 600 JPEG
Result: Image Type image/jpeg, Dimensions 800 x 600 px, Aspect Ratio 4:3, with a preview and a decoded-image.jpg download
Without a prefix the tool identifies the format from the first bytes: /9j/ is the Base64 form of the JPEG signature FF D8 FF.
How Raw Base64 Reveals the Image Type
| Base64 starts with | Format | Auto-detected |
|---|---|---|
| iVBORw0KGgo | PNG | Yes |
| /9j/ | JPEG | Yes |
| R0lGOD | GIF | Yes |
| UklGR | WebP (RIFF container) | Yes |
| PHN2Zy | SVG starting with <svg | Yes |
| PD94bW | SVG starting with <?xml | Yes |
| Qk | BMP | No, paste as a data URI |
Prefixes are the Base64 encoding of each format signature bytes.
- Paste a Base64-encoded image string or data URI into the input text area, or use the Paste from Clipboard button.
- The tool automatically detects the image format and renders a live preview.
- Verify the decoded image appears correctly and check its dimensions, type, and estimated size.
- Click the Download Image button to save the decoded image as a file.
- The file is saved in its detected format, such as PNG, JPEG, GIF, WebP, or SVG, with the matching extension.
Decoding a Base64 String Back to an Image
Paste a Base64 string and this tool shows the image it contains, with its type, dimensions and size, and lets you download it as a file. It accepts full data URIs as well as raw Base64 with no prefix.
A data URI names the format in its header, for example data:image/png;base64. Raw strings have no header, so the tool looks at the first characters. Every image format starts with fixed signature bytes, and these always encode to the same Base64 letters. A PNG begins with iVBOR, a JPEG with /9j/ and a GIF with R0lG. The tool recognizes PNG, JPEG, GIF, WebP and SVG this way. Anything else is treated as PNG. So paste BMP or ICO data as a full data URI.
When decoding fails, the string is usually incomplete. Copying from a log or a database viewer can cut it short. Line breaks and spaces inside the string are ignored. Characters outside the Base64 alphabet trigger a clear error. URL-safe Base64, which uses - and _ in place of + and /, needs converting to the standard alphabet first.
The download gets the right extension for the detected type, such as .jpg or .svg. Everything happens in your browser, so the data is not sent anywhere. To go the other way, use Image to Base64. For Base64 that holds text rather than an image, try Base64 Encode and Decode.
Sources
Frequently Asked Questions
Related Tools
Image to Base64 Converter
Convert any image file to a Base64-encoded string instantly in your browser. No server upload required.
Image and MediaBase64 Encode and Decode
Encode text to Base64 and decode Base64 strings back to readable text, with full UTF-8 support.
Developer ToolsSVG to PNG Converter
Convert SVG vector files to PNG raster images at any resolution directly in your browser using canvas.
Image and Media