Image to Base64
Turn any image into a Base64 data URI — and decode Base64 back to an image.
About this converter
Drop an image in and get its Base64 data URI with one-click copies for the raw
string, a CSS url(…) and an <img> tag. Paste any Base64
string into the decoder and get a preview and a download. Both directions run locally
in your browser — free, no account, nothing uploaded.
When to embed, when not to
A data URI puts the image inside your HTML, CSS or JSON — no separate file, no extra request. That's genuinely useful for tiny icons, email signatures where attachments get blocked, and quick prototypes. The trade-off is size: Base64 text is about 33% larger than the binary it encodes, and embedded images can't be cached separately. The working rule: embed under ~10 KB, link anything bigger. (The encoding itself is the same one the general Base64 tool does for text and files.)
Frequently asked questions
What is a Base64 data URI?
The image's bytes encoded as text and prefixed with its type — data:image/png;base64,… — so it can live inside HTML, CSS or JSON instead of being a separate file.
Why is the Base64 bigger than my image file?
Base64 represents every 3 bytes as 4 characters, an inherent ~33% overhead. That's the cost of making binary safe to paste into text.
When should I embed an image as Base64?
Small, frequently-used images — icons under ~10 KB, email signature logos, quick prototypes. Larger images are better as normal files: cacheable and smaller.
Can I convert Base64 back to an image?
Yes — paste the string (with or without the data: prefix) into the decoder for a preview and a download. It all happens on your device.