Image to Base64

Convert an image to a Base64 data URI you can paste anywhere.

Runs locally in your browser
Data URI No signup · local processing

Add an image to get its Base64 data URI

Drop an image on the left and this tool encodes it as a Base64 data URI, with ready-to-paste CSS and HTML snippets — all in your browser, nothing uploaded.

Runs entirely in your browser

Convert an image to a Base64 data URI, locally

This tool reads an image on your device and encodes it as a Base64 data URI — the self-contained data:image/... string you can drop straight into CSS, an HTML img tag, JSON, or an SVG. It is handy for inlining small icons and avoiding an extra network request. You get the raw data URI plus ready-to-paste CSS and HTML snippets, and the encoded size so you can judge whether inlining is worth it (Base64 adds roughly a third to the byte size). The image is read entirely in your browser with FileReader and is never uploaded anywhere.

Common questions

What is a Base64 data URI?

It is a string like data:image/png;base64,iVBORw0KGgo… that embeds the whole image inline as text. Browsers treat it as a real image source, so you can use it in CSS, HTML, or SVG without a separate file.

When should I inline an image as Base64?

It works best for small images — icons, tiny logos, simple backgrounds — where saving an HTTP request outweighs the size cost. Base64 makes the data about 33% larger, so it is a poor fit for large photos.

Which formats are supported?

Any image your browser can read: PNG, JPG, WebP, GIF, SVG, and more. The data URI keeps the original format and bytes — this tool encodes, it does not re-compress or convert the format.

How do I use the output?

Copy the CSS snippet for a background-image, the HTML snippet for an img tag, or the raw data URI to paste wherever you need it. All three are generated for you.

Is my image uploaded?

No. The image is read locally with the browser's FileReader API and encoded in your tab. Nothing is sent to a server, so it works offline and keeps your image private.