Image to Base64 Encoder

Free image to base64 converter. Upload a small image and get a ready-to-paste base64 data URI for inline HTML/CSS, or paste a data URI to decode it back to bytes. Runs entirely in your browser — images never leave your device.

Choose a small image to encode as a base64 data URI.
Paste a data URI to decode it back to bytes.

How image to base64 encoder works

Base64 encodes binary bytes into ASCII characters so an image can be embedded directly inside HTML or CSS as a data: URI instead of a separate file request. Every three bytes (24 bits) become four characters from a 64-symbol alphabet, with = padding when the byte count is not a multiple of three.

This tool reads your image with the browser FileReader API, converts the raw bytes to a base64 string, and wraps it in a data: URI of the form data:image/png;base64,<encoded>. You can paste that URI straight into an <img src> or a CSS url(). It also decodes data URIs back to bytes so you can inspect what is embedded.

Base64 data URIs increase size by about 33 percent and are best for small assets like icons, logos and placeholders. For large images a real file is more efficient. Everything happens locally — the image is never uploaded.

Frequently asked questions

What size image can I encode?
Up to about 10 MB. Because base64 adds ~33 percent overhead and data URIs are meant for small inline assets, very large images are better served as files.
Is my image uploaded anywhere?
No. The image is read in your browser with the FileReader API and processed entirely on your device. Nothing is sent to a server.
How do I use the data URI?
Paste it into an <img src="data:image/png;base64,..."> tag or a CSS url(data:image/png;base64,...). The browser renders it like a normal image with no extra request.
Can I decode an existing data URI?
Yes. Paste a data: URI into the decode field and the tool returns the raw bytes and detected MIME type.