Image to Base64

Convert images to Base64 encoded strings for embedding in HTML or CSS.

Convert an image to Base64 text so you can put it straight into HTML, CSS, JSON or an email without a separate file. Choose an image and copy the result as a data URI (data:image/png;base64,…), plain Base64, a ready-made <img> tag, a CSS background-image rule or a Markdown image. The tool shows the original size and the Base64 size, which is about a third bigger. The image is read in your browser and isn't uploaded.

or drag and drop here. Files stay on your device.

Common use cases

  • Embed a small icon or logo in HTML or CSS
  • Put an image in a JSON payload or an API test
  • Inline images in an HTML email template
  • Store a small image in a single-file app or document

How to use

  1. Choose an image.
  2. Pick the output: data URI, Base64 only, <img> tag, CSS or Markdown.
  3. Copy the text or download it.

FAQ

Why is the Base64 bigger than the image?

Base64 uses 4 text characters for every 3 bytes, so it's about 33% larger. Use it for small images only; large ones are better as separate files that browsers can cache.

Will Base64 images work in email?

Many email apps, including Gmail, block data-URI images. For email, attaching or hosting the image is more reliable.

How do I turn Base64 back into an image?

Use the Base64 to image converter.