About Image to Base64

Image to Base64 turns a picture into text you can paste straight into your code. Drop in a PNG, JPG, WebP, GIF or SVG and copy the data URI, the raw Base64, a ready-made CSS background-image rule or an HTML img tag.

The image bytes are encoded as they are, with no re-compression, so decoding the text gives back an identical file. To turn Base64 back into a picture, use Base64 to Image.

Your data never leaves your device: the work happens in your browser, with no upload and no account. It is free and adds no watermark.

How to convert an image to Base64

  1. Select or drop an image.
  2. Copy the data URI, raw Base64, CSS or HTML version.
  3. Optionally download the text as a .txt file.

Frequently asked questions

What is a Base64 image?

Base64 writes the bytes of an image as plain text. Put in a data URI such as data:image/png;base64,iVBOR…, it can be used in HTML, CSS or JSON without a separate image file.

Does it change or compress my image?

No. The bytes are encoded as they are, so the result decodes to an identical file. Base64 text is about a third larger than the file it came from.

Which image types work?

PNG, JPG, WebP, GIF, BMP, ICO, AVIF and SVG. The type is detected from the file itself, not just its name.

Is there a size limit?

Images up to 50 MB. Long output is cut off on screen so the page stays fast, but Copy always copies all of it.

Are my images uploaded?

No. The conversion runs in your browser and the image never leaves your device.