Image to Base64 Converter — Data URI, HTML & CSS
- This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.
About this tool
Drop an image and get it as a Base64 string, a full data URI, an HTML <img> tag or a CSS background-image rule. Copy the one you need and paste it into your code or email template.
A data URI puts the image inside the page itself, so it loads without a separate request. This suits small icons and logos; Base64 makes data about a third larger, so it is a poor fit for big photos.
The conversion happens in your browser. Your image is never uploaded to a server.
Frequently asked questions
How do I convert an image to Base64?
Drop the image above, then copy the Base64 or data URI output. Use the data URI as the src of an <img> tag or inside CSS url().
Is it safe to use for large images?
It works, but Base64 is about 33% bigger than the file and cannot be cached separately. For images over roughly 1 MB, a normal image file is usually the better choice.
Can I decode Base64 back into an image?
Paste a data URI into your browser’s address bar to view it. To convert plain Base64 text, use the Base64 Encode / Decode tool.