Image to Base64

Drop an image to get its Base64 data URI, ready to paste into HTML, CSS, JSON or an email template.

Type:

Encoded image

Private by design: your image is opened, edited and saved by your own browser with the Canvas API. It is never uploaded to a server, and the page keeps working offline once loaded.

What a data URI looks like

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…

The prefix names the MIME type; after the comma comes the file encoded as Base64 text.

Why Base64 is about 33% bigger

Base64 turns every 3 bytes into 4 printable characters, so the text is 4 ÷ 3 ≈ 1.33 times the original size, plus padding. A 30 KB PNG becomes about 40 KB of text.

File sizeBase64 length (approx.)
1 KB1.37 KB
10 KB13.7 KB
50 KB68 KB
100 KB137 KB
1 MB1.37 MB

When to inline images

Frequently asked questions

How do I use Base64 in an img tag?
Put the whole data URI in the src attribute: <img src="data:image/png;base64,…" alt="">. Use the “Copy as <img> tag” button.
How do I turn Base64 back into an image?
Paste it into the Base64 to image decoder.