Image to base64

Image to Base64 Converter

Turn any image into a Base64 string or data URI you can paste into HTML, CSS or code. Free, fast and private.

Drop images here or paste an image from your clipboard PNG, JPG, WebP, GIF, SVG, BMP, ICO or AVIF. Up to 10 files, 10 MB each
100% private Instant results Works on any device

How to convert an image to Base64

1

Add your image

Drop an image into the box above, or click the button to choose one.

2

Pick the output

Choose a data URI, plain Base64, an HTML image tag, a CSS rule or Markdown.

3

Copy or download

Copy the result with one click, or save it as a text file.

Frequently asked questions

What is Base64?

Base64 is a way to write binary data, such as an image, using only plain text characters. That lets you place an image directly inside HTML, CSS, JSON or an email instead of linking to a separate file.

What is the difference between a data URI and plain Base64?

Plain Base64 is just the encoded text. A data URI adds a short prefix such as data:image/png;base64, in front of it, so browsers know what kind of file it is. Use the data URI when you paste it into an image source or a CSS url().

When should I use Base64 images?

They work well for small images such as icons and logos, where saving a separate file request is useful. Avoid them for large photos: Base64 makes the data about 33% bigger, and the browser cannot cache the image separately.

Is my image uploaded to a server?

No. The encoding runs entirely in your browser, so your images stay on your device and we never see them.