About Image to Base64
This encodes an image into a Base64 data URI — a text string that represents the whole image — and decodes such strings back into a viewable image. Developers use data URIs to embed a small image directly in HTML or CSS (an icon, a logo, an email-safe graphic) so it loads with the page instead of as a separate request. It's also handy for pasting an image into a JSON payload or a config file where only text is allowed.
How it works
Encoding reads your image file and produces a data: URI — for example data:image/png;base64,iVBORw0KGgo… — which you can paste straight into an <img src>, a CSS background: url(...), or anywhere a text string is needed. It also shows the size of the resulting text. Decoding takes a Base64 string or full data URI, renders it back to an image you can preview and download. Everything happens in your browser.
Assumptions and behaviour
- Encoding outputs a complete data URI (including the
data:image/…;base64,prefix), ready to drop into HTML or CSS. - Decoding accepts either a full data URI or a bare Base64 string (it assumes PNG if no type is given).
- The encoded text's size is shown, so you can judge whether embedding is worthwhile.
- Whitespace in pasted Base64 is ignored on decode.
Limitations
- Base64 is about 33% larger than the original binary. Embedding inflates your HTML/CSS, so it's best for small images (icons, tiny logos); large images are better served as normal files.
- Embedded data URIs aren't cached separately by the browser, so reusing the same large image across pages via data URIs wastes bandwidth compared with a shared file.
- It handles image data URIs; it isn't a general file encoder.
- Very large images produce a very long text string that can be unwieldy to handle.
Privacy
Encoding and decoding run entirely in your browser. Your image and the Base64 text never leave your device.

