Base64

Image to Base64 Converter

Turn an image into Base64 to embed it directly in HTML, CSS, JSON or an email — no separate image file needed.

Up to 10 MB. Your image is processed and returned straight away; it isn't stored.

How to convert an image to Base64

  1. Choose a PNG, JPG, WebP, GIF or SVG image.
  2. Press Convert to Base64.
  3. Copy the plain Base64, the data URI, or the ready-made HTML or CSS.
  • The image is encoded exactly as uploaded — it isn't recompressed.
  • Base64 is about 33% larger than the file, so it suits small images such as icons and logos best.
  • To turn Base64 back into a file, use the Base64 to Image tool.

Image to Base64: frequently asked questions

How do I convert an image to Base64?

Choose a PNG, JPG, WebP, GIF or SVG image and press Convert to Base64. You get the plain Base64, a data URI, and ready-to-paste HTML and CSS.

How do I use a Base64 image in HTML or CSS?

Use the data URI as the image source, for example <img src="data:image/png;base64,…">, or in CSS as background-image: url("data:image/png;base64,…"). The tool generates both for you.

When should I embed images as Base64?

For small images such as icons and logos it saves an extra request. For large images it is better to keep a separate file, because Base64 is about 33% bigger.

More Base64 tools