Base64 to image converter
Updated Nothing is uploaded
Paste Base64 text or a full data URI (even from CSS or an <img> tag) to see the image and download it with the right file extension. The file type is detected from its bytes.
How to convert Base64 to an image
- Paste the Base64 string or data URI into the box (whitespace and line breaks are fine).
- The image previews instantly with its type, dimensions and size.
- Press Download to save it as a PNG, JPG, GIF, WebP, SVG… file.
How the type is detected
Every image format starts with a signature ("magic bytes"). After decoding, we read the first bytes to pick the right extension, even if the data URI says something else:
| Format | Base64 usually starts with | Magic bytes |
|---|---|---|
| PNG | iVBORw0KGgo | 89 50 4E 47 |
| JPG | /9j/ | FF D8 FF |
| GIF | R0lGOD | 47 49 46 38 (GIF8) |
| WebP | UklGR | RIFF … WEBP |
| SVG | PHN2Zy or PD94bWwg | <svg or <?xml |
Fixing broken Base64
- URL-safe Base64 (with
-and_) and missing=padding are fixed automatically. - "Invalid length" usually means the string was cut off when copying — copy it again in full.
- If it decodes but won't display, the data may not be an image (for example a PDF or ZIP).
Private by design
Everything runs in your browser — your images and videos are never uploaded, stored or seen by anyone.
Related tools
Frequently asked questions
Is my data sent anywhere?
No. Decoding happens in your browser.
Do I need the data:image/… prefix?
No. Raw Base64 works too; the file type is detected from the content.
Why does it say it's not an image?
The decoded bytes don't match any image format your browser can show — the string may be truncated, double-encoded or a different file type.
Your business here? Sponsor this tool from $9/week. See placements