Image to Base64

Encode images as Base64 data URIs.

Drag & drop an image here, or use the button above.

Everything runs locally — your image is never uploaded.

Free image to Base64 encoder

This tool converts an image into a Base64 data URI — a single text string that contains the entire picture. Once encoded, you can paste it directly into your HTML or CSS to embed the image inline, with no separate file and no extra network request. It's ideal for small icons, logos, email graphics, and simple background patterns. Everything happens right in your browser using the FileReader API, so your image is never uploaded, stored, or shared — it stays completely private on your device.

How to convert an image to Base64

  1. Click Choose an image, or drag and drop a file onto the drop zone.
  2. See the live preview along with the file's name, type, and size.
  3. Copy the full Base64 data URI with the Copy button.
  4. Or grab the ready-to-paste HTML or CSS snippet instead.

When to inline images as Base64

Base64 encoding adds about 33% to a file's size, so it works best for small assets. Inlining a tiny icon avoids an extra HTTP request, but embedding a large photo bloats your markup and prevents the browser from caching it separately. As a rule, inline small graphics and keep big images as regular files. Very large files still encode here — the resulting string is simply long, so expect a lengthy data URI.

Related tools

Need to work with raw Base64 text rather than images? Our Base64 encoder and decoder converts plain text and data URIs in both directions. And if you're embedding a link instead of an image, the QR code generator turns any URL into a scannable code — both run entirely in your browser, too.

Frequently asked questions

What is a Base64 image data URI?

A data URI encodes an image directly as text using Base64, in the form data:image/png;base64,…. Because the whole image is embedded in the string, you can drop it straight into an HTML src or a CSS background-image without linking to a separate file. It is handy for tiny icons, email templates, and inlining assets to save an extra network request.

Are my images uploaded to a server?

No. The conversion happens entirely in your browser using the FileReader API. Your image never leaves your device, is never uploaded, and is never stored, which makes this safe for private, sensitive, or unpublished graphics.

Which image formats are supported?

Any format your browser can read works, including PNG, JPG/JPEG, GIF, WebP, SVG, BMP, and ICO. The tool keeps the original format and simply wraps the file bytes as a Base64 data URI, so the encoded image looks identical to the source.

Should I inline large images as Base64?

Usually not. Base64 encoding makes a file roughly 33% larger, and very large data URIs bloat your HTML or CSS and cannot be cached separately by the browser. Inlining is best for small images — icons, logos, and simple backgrounds. For big photos, a normal image file with a real URL is faster.

How do I turn a Base64 string back into an image?

Paste the full data URI into any HTML img tag or CSS url() and the browser will render it. To decode raw Base64 text back to its original bytes, use our Base64 encoder and decoder tool.