imagetoolbox

Convert an image to Base64

The file as a data URL, ready to paste. Copy the raw string, an img tag or a CSS background rule.

How to convert an image to base64

  1. Drop an image in the zone above. The original file is encoded as is, byte for byte.
  2. Copy the raw data URL, the img tag or the CSS rule.
  3. Mind the size. Base64 adds about a third, so it is for small images.

When Base64 makes sense

Inlining spares a network request, which is worth it for tiny icons, tracking-free email signatures and single-file HTML documents. The encoded string is about 33 percent larger than the file, so it stops making sense quickly as images grow.

The file is encoded exactly as it is, with no re-compression, so what you inline is byte for byte what you dropped.

Like everything on this site, the tool runs entirely in your browser. Your image is never uploaded, and the server only serves this page.

More tools

All image tools

Everything runs in your browser. Your files never leave your device. No uploads, no accounts.