# Base64 to Image

> Paste a data URL or Base64 string to preview the image, detect its real type from the bytes, see its size and dimensions, and download it as a file.

- URL: https://www.tooljig.com/base64-to-image
- Category: [Converters](https://www.tooljig.com/category/converters.md)
- Runs: In the browser; nothing uploaded
- Price: free, no account needed

## What it does

Paste a data: URL or raw Base64 text and the tool decodes it, identifies the format from the file's magic bytes (PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, TIFF or SVG) rather than trusting the declared type, and shows a preview with the pixel dimensions and byte size. Download it with the correct file extension or copy a cleaned-up data URL. Whitespace and line breaks are ignored, and decoding happens entirely in your browser.

## How to use it

1. Paste a data URL or Base64 string.
2. Check the detected type, dimensions and preview.
3. Download the image or copy the normalised data URL.

## Good to know

- Invalid characters, wrong padding and truncated text are reported with their position. URL-safe Base64 (- and _) and missing = padding are accepted, as are percent-encoded data URLs such as data:image/svg+xml;utf8,….
- SVG is previewed in an <img> element, where scripts inside the SVG never run. TIFF is recognised and can be downloaded, but most browsers other than Safari cannot display it.

## FAQ

### What if the data URL says the wrong type?

The type is detected from the decoded bytes. If the header says image/png but the data is a JPEG, the tool tells you and downloads it as .jpg.

### Why do I get an error for valid-looking text?

Base64 only uses A–Z, a–z, 0–9, + and / (or - and _), with = padding at the end. Anything else, or a length that cannot come from whole bytes, usually means the text was cut off or mixed with other content.

### Is the image sent anywhere?

No. The text is decoded and displayed in your browser.

## Related tools

- [Image to Base64](https://www.tooljig.com/image-to-base64.md): Convert images to Base64, a data URL, an <img> tag or a CSS background-image, with the size increase shown. Several files at once; nothing is uploaded.
- [Base64 Encode / Decode](https://www.tooljig.com/base64-encode-decode.md): Encode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe option. Private and instant.
- [Image Converter](https://www.tooljig.com/image-converter.md): Convert images between PNG, JPG, WebP, GIF, BMP, TIFF and ICO.
