Drop an image to get its Base64 data URI, the raw Base64 string and ready-to-paste HTML and CSS snippets. Or paste a Base64 string to preview the image and download it. Files are read in your browser and never uploaded.
A data URI embeds a file directly in text, so a page can include an image without a separate request. It looks like this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...The part before the comma says the type (image/png) and the encoding (base64); the rest is the image bytes written as Base64. You can use it anywhere a URL is accepted:
<img src="data:image/png;base64,..." alt="icon">
.logo { background-image: url("data:image/png;base64,..."); }| Good fit | Poor fit |
|---|---|
| Small icons and tiny logos (a few KB) | Photos and large images |
| Single-file HTML pages and demos | Images used on many pages (they can't be cached separately) |
| CSS you want to ship in one file | Content where file size or page speed matters most |
| Quick prototypes and test data | Email, where some clients block data URI images |
Base64 makes data about 33% larger than the original file, and the tool shows the exact increase for your image. Inlining also stops the browser caching the image on its own, so keep embedded images small.
Paste a full data URI to preview it as-is. If you paste only the Base64 characters with no data: prefix, the tool previews them as a PNG; if your image is another type and doesn't appear, paste the complete data URI so the correct type is included. Use the preview to confirm the image is intact before you save it.
Encode or decode any text with Base64 Encoder / Decoder, put a link on a poster with the QR code generator, or minify the CSS that contains your data URI with the CSS minifier.