Base64 Image Encoder (Image to Data URI)

Convert an image file to a Base64 data URI — embed images directly in HTML, CSS or JSON.

How it works

The file's bytes are encoded with the browser's FileReader as a data URI: data:image/png;base64,…. Nothing is uploaded — reading happens locally.

Examples

InputOutput
small PNGdata:image/png;base64,…
icon JPEGdata:image/jpeg;base64,…
SVG filedata:image/svg+xml;base64,…

Frequently Asked Questions

Where do I use the result?

Paste it into HTML <img src>, CSS background-image: url(…), or JSON — the image then needs no separate file request.

Is my image uploaded to a server?

No — the file is read by your browser locally; the data URI never leaves your device.

What size limit?

2 MB per file. Data URIs are about 33% larger than the raw file, so keep embedded images small (icons, logos).

Related Tools

URL Encoder (Percent Encoding)URL DecoderBase64 EncoderBase64 Decoder