Skip to content
AlroundTools

Image to Base64

Convert an image to a Base64 data URL, CSS background or HTML img tag.

Runs in your browser – your files are not uploaded

How to use Image to Base64

  1. 1

    Drop or choose an image.

  2. 2

    Pick the output: data URL, Base64 only, CSS or HTML.

  3. 3

    Copy the text or download it as a .txt file.

About Image to Base64

Embed small images directly in HTML, CSS, JSON or emails without a separate file. Drop an image and get it as a data URL, as raw Base64, as a ready-made CSS background-image rule or as an HTML img tag.

The file is encoded byte for byte in your browser, without re-compression and without upload. The tool shows the original size and the size of the resulting text, so you can see how much larger it gets.

Frequently asked questions

Why is the Base64 text bigger than the image?

Base64 represents 3 bytes with 4 characters, so the text is about 33 % larger than the file. That is why it is best for small icons and graphics.

Is the image changed or compressed?

No. The original file bytes are encoded unchanged, including metadata such as EXIF.

Can I convert Base64 back to an image?

Yes, use the Base64 to image tool. For text and other files, use the general Base64 encoder.