Binatomy
Converter

Image to Base64

Upload or drop an image and instantly get its Base64 Data URI, with ready-to-use HTML and CSS snippets. All in the browser, no upload

Drop an image here

or

Browse files

PNG, JPG, GIF, SVG, WebP...

FAQ

Frequently Asked Questions

Everything you need to know about Base64 images

What is a Base64 Data URI?

A Data URI is a string that embeds the content of a file (an image in this case) directly into the code, with no need for an external file. It has the format data:image/png;base64,XXXX where XXXX is the Base64-encoded image. You can paste it into the src attribute of an img tag or into a CSS background-image rule.

Why is the encoded image larger than the original?

Base64 encoding represents every 3 bytes of binary data with 4 text characters, so it increases the size by about 33%. That is why inlining in Base64 is only worthwhile for small images (icons, logos): it reduces HTTP requests, but for large images a normal file is better to avoid bloating HTML and CSS.

Are my images uploaded to a server?

No. The conversion happens entirely in your browser using the JavaScript FileReader API: the image never leaves your device and is not sent to any server. This makes the tool private and very fast, and it even works offline once the page is loaded.

What is a Data URI?

It is a string that carries the file content inside itself, in the form data colon, file type, base64, then the data. You paste it where the address of an image would go, and no external file is needed.

Why is the string bigger than the file?

Because Base64 represents every three bytes with four text characters, so the weight grows by about a third. It pays off only for small icons and logos, where it saves one HTTP request.

Is the image sent to a server?

No, the browser does the conversion with the JavaScript FileReader, so the file never leaves the device. The tool keeps working with no connection, once the page is open.