Image to Base64 (Data URL)

Free online image-to-Base64 (Data URL) converter. Choose an image to get an encoded string you can paste straight into an HTML img tag or CSS background, with original and encoded sizes shown. It converts locally in your browser and never uploads the image — handy for inlining small icons. DeveloperImageRuns locally

Use this tool

Click to choose an image, or drag one here
Converted locally, never uploaded

How to use

  1. Click to choose an image.
  2. The Base64 (Data URL) text and a preview are generated immediately.
  3. Copy it and paste it into your code.
Scan to use on your phone · Share it

Free, no install. Open this tool instantly in any browser — everything runs on your own device.

Frequently asked questions

When should I inline an image as Base64?

Inlining small icons or tiny images as Data URLs removes a network request; avoid it for large images, which would bloat your code.

Is the image uploaded?

No, conversion is local and the Data URL only appears on your page.

Why is the result larger than the image?

Base64 text encoding is about one third larger than binary by design, which is why it suits only small images.

Related tools