Image to Base64 converter

Convert an image into a Base64 data URI for HTML and CSS.

  • Development
  • 100% free
  • No sign-up
  • Runs in your browser
Image to Base64 converter
The image never leaves your device.

What is the image to base64 converter?

The image to Base64 converter reads an image file in your browser and turns it into a data URI, a Base64 string that can be placed directly in HTML, CSS, JSON or emails, without a separate image file.

Inlining saves an HTTP request for very small images such as icons, but Base64 is about a third bigger than the file, so keep large images as normal files.

How to use the image to base64 converter

  1. 1Choose an image file.
  2. 2The data URI is created right away.
  3. 3Copy the data URI, the CSS or the HTML code.

Features

Any image

PNG, JPG, GIF, SVG, WebP, ICO and more.

Ready snippets

HTML img tag and CSS background-image.

Size info

See the original and the Base64 size.

Private

The image never leaves your device.

Frequently asked questions

What is a data URI?

A URL that contains the file itself, such as data:image/png;base64,iVBOR…, instead of pointing to a file.

When should I use Base64 images?

For tiny images like icons, or where external files aren't possible, such as some email templates.

Why is the Base64 string bigger than the file?

Base64 uses 4 characters for every 3 bytes, about 33% more.

Is my image uploaded?

No, it's read and converted in your browser.