How to use the Base64 to Image Converter
- 1. Paste the Base64With or without the data:image/…;base64, prefix. Line breaks are fine.
- 2. DecodeThe tool checks the text, decodes it and reads the file's header bytes.
- 3. DownloadSee the image and save it with the right file extension.
How decoding works
Base64 writes binary data using only 64 safe characters (A–Z, a–z, 0–9, + and /), with = as padding at the end. Every 4 Base64 characters hold 3 bytes, so decoding shrinks the text to about three quarters of its length. The tool also accepts the URL-safe variant, which uses - and _ instead of + and /.
The file type is not taken on trust from the data: prefix. The tool reads the first bytes of the decoded file, its "magic number": PNG files start with 89 50 4E 47, JPEGs with FF D8 FF, GIFs with GIF8, and so on. If the prefix says JPEG but the bytes say PNG, you get the real type and a note.
Worked example and common problems
The sample is a small PNG written as a data URL. Decoding it gives PNG, with the decoded size and the length of the Base64 text shown side by side. Press Download to save it as image.png.
- "Not valid Base64": stray characters such as quotes or a JSON comma got copied too. Paste only the string.
- "Not a recognised image": the data decodes, but it is another kind of file, or it is cut short.
- Huge strings: API responses sometimes embed large images. Saving them as files and linking to them is usually better for page speed.
Everything happens in your browser, so private screenshots or ID images never leave your device.
Frequently asked questions
What is a data URL?
A Base64 string with a prefix like data:image/png;base64, that browsers can use directly as an image source.
Can it decode PDFs?
It recognises a PDF header, but this tool is built for images and only previews image formats.
Why is my image blank?
The Base64 may be cut off. Check that you copied the whole string, including any = at the end.
Is the base64 to image converter free?
Yes, it is free. Decoding your first image asks for your name and WhatsApp number once, and after that the base64 to image converter and every other Uncodemy tool open without the form.