Image to Base64 Converter

Drop a PNG, JPEG, GIF, WebP, SVG or ICO image to get its Base64 string and a data URI you can paste straight into HTML, CSS, Markdown or JSON. Large photo? Resize it and choose WebP or JPEG quality first, so the Base64 stays small - the size difference is shown before you copy.

Runs in your browser - nothing is uploaded Free, no sign-up Instant, works offline once loaded

How to use the Image to Base64 tool

  1. Drop an image on the box, click to choose one, or paste it from the clipboard (Ctrl+V).
  2. Optional: set a maximum width and a format/quality to make the result smaller.
  3. Choose the output - data URI, raw Base64, HTML <img>, CSS background, Markdown or JSON - and copy it.

Questions and answers

What is a data URI?

A data URI puts the file itself into a link: data:image/png;base64,iVBOR... Browsers show it like a normal image address, so small icons need no extra download.

When should I embed images as Base64?

For small images (under about 10 KB) such as icons and logos in e-mails, single-file HTML pages or CSS. Large photos are better as normal files: Base64 makes them a third bigger and they cannot be cached separately.

Are SVG images encoded too?

Yes. For SVG in CSS a URL-encoded data URI is often shorter than Base64 - the tool offers both.

Is my data uploaded to a server?

No. Every conversion on this page runs inside your browser with JavaScript. Your text and files never leave your computer, which is why it also works for private keys, contracts and photos.

Is the tool free?

Yes, free without sign-up and without limits other than your computer's memory. The site is paid for by the small ads on the left and at the bottom.

Related tools

Ad