Image to Base64
Convert an image to a Base64 data URI, CSS background or HTML img tag.
Runs in your browser — your data never leaves your device.
About the Image to Base64
Embedding a small image directly in HTML, CSS or an email template saves a separate download. Choose an image to get its Base64 code in the format you need.
Base64 is about 33% larger than the original file and cannot be cached separately, so use it for small icons and logos, not photos.
How to use the Image to Base64
- Choose or drop one image (up to 5 MB).
- Pick the output: data URI, Base64 only, CSS background or HTML
<img>. - Copy the code.
How it works
The file's bytes are encoded with Base64 (every 3 bytes become 4 characters) and prefixed with its type, for example data:image/png;base64,.
Examples
- A 2 KB PNG icon → about 2.7 KB of Base64 text, ready for
background-image: url("data:image/png;base64,…").
Frequently asked questions
Are my images uploaded?
No. Everything happens in your browser, on your own device. Your images are never sent to our server.
When should I not use Base64 images?
For anything larger than about 20 KB. A normal image file loads in parallel and can be cached by the browser, which is faster.