Updated 2026-08-02
Convert an image into a Base64 data URI — or paste one back and see what it is. Choose the shape you
need: a raw data URI, a CSS background-image, an HTML <img> tag, Markdown, or the bare Base64
string.
The part most converters leave out is whether you should be doing this at all. Base64 always costs about 33% more bytes than the file, so this tool shows the before and after sizes and says plainly when inlining is the wrong call — above roughly 10 KB the inlined bytes get re-sent with every page and cannot be cached separately, which usually costs more than the request you saved. For SVG it points you at percent-encoding instead, which is smaller than Base64 and stays readable.
Everything happens in your browser through the standard FileReader API. There is no API endpoint
for this tool, because an API would have to receive the bytes this page promises not to send.
icon.png — 1.2 KB
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUg…");
1.2 KB became 1.6 KB (+33%). At this size inlining is reasonable — it saves a request.
photo.jpg — 240 KB
240 KB became 320 KB (+33%). Over about 10 KB, inlining usually costs more than it saves: the bytes are re-sent with every page and cannot be cached separately.
data:image/png;base64,iVBORw0KGgo…
image/png · 64×64 · about 1.6 KB decoded (preview shown, with a download button)