Image to Base64

Encode any image as a Base64 data URI for CSS or HTML.

Click or drop an image here

🔒 100% browser-based — your data never leaves your device.

About this tool

Convert an image into a Base64 data URI you can paste straight into HTML (), CSS (background-image: url(data:...)) or JSON. Embedding small images this way removes an extra network request, which is handy for icons, tiny logos and email signatures.

The tool shows the encoded size so you can judge whether embedding makes sense — Base64 is about 33% larger than the binary file, so it is best for images under a few kilobytes.

Frequently asked questions

When should I use Base64 images?

For very small images (icons, 1–10 KB) where saving an HTTP request outweighs the 33% size overhead. Large photos should stay as normal files.

Why is the Base64 string larger than my file?

Base64 represents every 3 bytes of binary data with 4 text characters, which adds roughly one third to the size.

Which formats are supported?

Any image your browser can read — PNG, JPG, GIF, WebP, SVG, BMP and more. The data URI keeps the original format unchanged.