Image to Base64
Pick an image to get its Base64 string, a ready-made data URI, an <img> tag and a CSS background rule. Switch modes to turn Base64 back into a downloadable image.
Data URI
Choose an image to encode it.
About this tool
A data URI embeds the file bytes directly in the page, so a small icon or logo can load without an extra HTTP request. Base64 encodes binary as text at a cost of about 33% extra size, which is why the technique suits small images only; anything over a few kilobytes is better served as a normal file that the browser can cache.
The decoder accepts a full data URI or a bare Base64 string and shows a live preview. It detects the MIME type from the URI prefix and names the download accordingly. Both directions run entirely in your browser.
Frequently asked questions
- When should I embed images as Base64?
- For tiny assets such as icons, tracking pixels, small logos in emails, or when a single self-contained HTML file is required. Larger images should stay separate files.
- Why is the Base64 text bigger than my file?
- Base64 represents every 3 bytes with 4 characters, so the text is about one third larger than the binary file.
- Is there a size limit?
- Files up to 10 MB are accepted; very long strings are truncated in the preview but the copy button always copies the full text.