Convert images to Base64

Encode any image as a Base64 string or data URI, ready to paste into HTML, CSS, JSON or email templates. Copy the snippet you need with one click.

Your images are processed on your device and are never uploaded.

Loading engine…

How to use this tool

  1. 01

    Add an image.

  2. 02

    Choose the output: data URI, raw Base64, an HTML img tag or a CSS background.

  3. 03

    Copy the result to your clipboard or download it as a text file.

Inline small assets

Embedding icons and small images as data URIs saves an HTTP request and keeps a single HTML or CSS file self-contained.

Mind the size

Base64 is about a third larger than the original file. It is best for images of a few kilobytes; compress larger images first.

Frequently asked questions

What is a data URI?

A data URI is a Base64 string prefixed with its MIME type, like data:image/png;base64,…, that browsers can use anywhere a URL is expected.

Is there a size limit?

Very large strings can slow down your editor. The tool warns when the output is over one megabyte.

Is my image uploaded?

No. Encoding happens in your browser.

Related tools