B64

Image to Base64 Converter data uri

Convert an image into a Base64 data URI, or preview and save a Base64 string as an image.

mode
OUTPUTbase64
0 lines 0 chars
1
PREVIEWimage
β€”
Select an image
processed in the browser Β· never uploaded
Tool Guide

What this tool does

A data URI embeds an image directly in a document as a string rather than as a separate file. Put a value starting with data:image/png;base64, into an img tag or a CSS background-image and the browser renders it as an image.

The benefit is one fewer request. A small icon needs no separate HTTP round trip, and environments that cannot reference external files, such as email templates or single-file HTML documents, can carry images inline.

The cost is size. Base64 expresses three bytes as four characters, so the result grows by roughly 33 percent, and this tool reports exactly how much larger it became. In the other direction, it decodes a long data URI found in code so you can see which image it actually is.

When to use it

Use it to inline a small icon in CSS, to embed images in an email template, to build a self-contained HTML document, or to identify an unfamiliar data URI in a codebase.

Input and output examples

Input Select a PNG icon
Output data:image/png;base64,iVBORw0KGgo... roughly 33 percent larger than the file

The data URI prefix can be included or omitted.

Input Paste a data URI string
Output Image preview and download

Useful for identifying a string found in code.

Notes and limitations

Data URIs suit small images only. A large payload makes the document heavier, delays first render, and forfeits browser caching, so an image reused across pages is better served as a file. A few kilobytes is a reasonable ceiling. Search engines also cannot treat an embedded image as an indexable asset, so avoid data URIs for content that should appear in image search. All processing happens in the browser and nothing is uploaded.

Frequently asked questions

Why does the size grow?

Base64 carries six bits of payload per eight-bit character, so output runs about 33 percent larger. That is inherent to the encoding.

Can I embed large images this way?

It is not advisable. The document becomes heavy and caching benefits disappear. Keep it to small icons.

Copied