Skip to content
toola.

img → data:

Convert images to Base64

Encode small images and icons as Base64 so you can embed them straight into HTML, CSS, email templates or JSON — no separate file request. Copy the result as a data URI, raw Base64, an <img> tag or a CSS background rule.

Private: your files never leave your device.

How was this tool?

How to use Image to Base64

  1. Step 1: Drop one or more images.

  2. Step 2: Choose the format: data URI, Base64 only, HTML or CSS.

  3. Step 3: Copy the code for each image.

When to inline images

A data URL puts an image directly inside HTML, CSS or JSON, saving one network request. That helps for tiny icons, email templates where external images are blocked, and single-file demos.

For anything larger than a few kilobytes, a normal image file is better: Base64 makes it about a third bigger, and the browser cannot cache it separately from the page. Shrink images first with Compress image.

Frequently asked questions

When should I use Base64 images?

For small icons and logos (a few KB) where saving a network request matters, or where only text is allowed, such as some email templates and JSON APIs.

Why is the Base64 bigger than my file?

Base64 represents every 3 bytes as 4 characters, so it’s about 33% larger than the original file.

Are my images uploaded?

No. Encoding happens in your browser.