Skip to content
Toolbox

Image to Base64 Converter

Convert PNG, JPG, SVG, WebP and GIF images to Base64 data URIs. Drag and drop, then copy as CSS, HTML or raw string.

Drag an image here, or

PNG, JPG, SVG, WebP or GIF · up to 5.00 MB · never uploaded

About Image to Base64

Embed a small image directly in your CSS or HTML as a data URI, removing a network request. Best suited to icons and textures under about 10 KB — beyond that the roughly 33 percent size penalty of Base64 outweighs the saved round trip.

How to use it

  1. Drop an image onto the drop zone, or pick a file.
  2. Wait for the preview to appear.
  3. Copy the output as a raw string, a CSS background rule, or an <img> tag.

Frequently asked questions

Are my images uploaded anywhere?

No. The file is read with the browser's FileReader API and converted locally. It never leaves your device.

Why is the Base64 bigger than my file?

Base64 encodes three bytes as four characters, so the result is about 33 percent larger. That is the unavoidable cost of representing binary data as text.

When should I not use data URIs?

For anything large or reused across pages. Data URIs cannot be cached separately, so an embedded image is re-downloaded with every page that inlines it.

In-depth reads that go beyond the calculator.