Image to Base64 Converter
Encode an image as a Base64 data URI, with ready-to-paste CSS and HTML.
Choose an image to encode as Base64or drag & drop · processed privately in your browser
About the Image to Base64 Converter
Embedding a small image directly in your code as a Base64 data URI saves an extra network request — handy for icons, email signatures and CSS backgrounds. The AlarmDaddy Image to Base64 Converter turns any image into a data URI and gives you ready-to-paste CSS and HTML snippets too.
It runs in your browser, so the image is never uploaded. Copy the output with one click.
How to use this calculator
- 1Choose or drag in an image.
- 2Copy the Data URI, or the ready-made CSS or HTML snippet.
- 3Paste it into your stylesheet or markup.
The formula
A data URI inlines a file as text: a prefix declaring the MIME type, then the file's bytes encoded in Base64. Browsers treat it exactly like a linked image. Base64 adds about 33% to the byte size, so it's best for small images.
Frequently asked questions
For small images like icons and logos, inlining avoids an extra HTTP request. For large images it is counter-productive — Base64 is ~33% bigger and can't be cached separately.