Skip to content

Image to Base64 Converter

Encode any image into a Base64 data URI and copy it as ready-to-paste HTML, CSS or JSON — without the file ever leaving your machine.

Drop an image here, click to browse, or paste (Ctrl+V)
Any format · nothing is uploaded

How to encode an image to Base64

  1. Add your imageDrop it above, browse for it, or paste it from the clipboard.
  2. Pick a snippet formatRaw data URI, a complete HTML <img> tag, or a CSS background-image rule — whatever you need to paste.
  3. Copy itOne click copies the whole snippet to your clipboard, ready to paste into your code.

What is Base64 encoding used for?

A Base64 data URI embeds an image directly inside text — HTML, CSS, JSON or even a database field — so the browser needs no extra request to fetch it. That makes it perfect for tiny assets: logos, icons, badges, spacer images, or images inside single-file documents and HTML emails.

The trade-off: Base64 is about 33% larger than the binary file, and embedded images are not cached separately by the browser. As a rule of thumb, embed images under ~10 KB and link everything else as a normal file. Use the image compressor first to get the encoded size down.

FAQ

What does a data URI look like?

It starts with the MIME type, then ;base64,, then the encoded data — for example data:image/png;base64,iVBORw0KGgo…. Anywhere a URL is accepted (img src, CSS url(), fetch), a data URI works.

How much larger is Base64 than the file?

Roughly 33% bigger, since every 3 bytes become 4 characters. The tool shows the exact encoded size next to the original so there are no surprises.

Does Base64 work in HTML emails?

Support is patchy — some clients (notably Outlook desktop) strip or block data URIs. For email newsletters, hosted images are still the reliable choice.

Are my images uploaded anywhere?

No. Encoding happens locally in your browser with the File API. Nothing is transmitted anywhere.

Related tools