Image to Base64 Converter
Convert an image file into a Base64-encoded string for embedding in code, or decode Base64 back into an image.
About this tool
Base64 encoding turns an image into a plain text string that can be embedded directly inside HTML, CSS, or JSON — useful for small icons, inline email images, or quick prototyping without hosting a separate file. This tool converts an image file to its Base64 data URI, and can also decode a data URI back into a viewable image.
How to use it
- To encode: choose an image, then copy the generated Base64 string.
- To decode: paste a data URI (starting with data:image/...) into the decode box and click Preview image.
Tips
- Base64 strings inflate file size by roughly 33% compared to the original binary file — fine for small icons, not ideal for large photos.
- The output starts with data:image/[type];base64, which is required for it to work when pasted into an src attribute or CSS.
FAQ
Where can I use the Base64 output?
Directly in an HTML <img src="..."> attribute, or a CSS background-image: url(...) value.