ConvertAnyFiles

Image to Base64 Converter

Turn an image into a Base64 data URI you can paste straight into HTML, CSS, JSON or an email template, so the image travels inside the code instead of as a separate file.

Free · No sign-up · Files stay on your device

How to use Image to Base64

  1. 1Choose an image.
  2. 2Pick the output: data URI, raw Base64, HTML or CSS.
  3. 3Copy the code.

Features

  • Data URI, raw Base64, HTML and CSS outputs
  • PNG, JPG, GIF, WebP, SVG and ICO
  • Shows original and encoded size
  • Preview of the image
  • Converted locally in your browser

When to embed images as Base64

Base64 is handy for small icons and logos in emails, single-file HTML pages, CSS sprites and API payloads, because it saves an extra download. Base64 makes files about 33% larger, so keep using normal image files for photos and large images.

Frequently asked questions

Why is the Base64 bigger than the image?

Base64 uses 4 characters for every 3 bytes, so the text is about 33% larger than the original file.

Is there a size limit?

Up to 10 MB, though Base64 is best for images under about 10 KB.

Can I convert Base64 back to an image?

Yes. Use the Base64 to Image tool.

Related tools