Convert any image into a Base64-encoded string for embedding directly in HTML or CSS.
Last updated: 14 July 2026
Choose the image you want to convert.
→It converts your image's binary data into a Base64 text string.
→Copy the generated data URI, ready to embed directly in HTML or CSS.
Base64 encoding converts binary data (like an image file) into a text string made up of letters, numbers, and a few symbols — this lets an image be embedded directly inside HTML, CSS, or JSON as text, instead of being a separate linked file. This tool reads your image's raw bytes and converts them into that text representation, wrapped in a "data URI" like data:image/png;base64,iVBORw0KG... that browsers can render directly.
Base64 encoding is not compression — it's a re-encoding of binary data into a text-safe format, and this process typically increases file size by roughly 33%, since every 3 bytes of original binary data become 4 characters of Base64 text. A 100 KB image becomes roughly 133 KB once Base64-encoded, which is an important trade-off to consider before embedding large images this way.
Useful for embedding small icons or images directly in code without a separate file request, or for email templates that need self-contained images. For larger images or photos, linking to a regular image file is usually more efficient than Base64 embedding, both for file size and browser caching behavior.
The generated Base64 string works in any context that accepts standard data URIs — CSS backgrounds, HTML <img> tags, JSON payloads, and most email clients that support inline images.
<img src=> tag to render it.