Convert any image into a base64 data URI plus ready-made snippets for CSS, HTML, and Markdown — encoding happens locally.
or drop a file here
All encoding and rendering happens locally in this browser tab. Nothing is uploaded to a server.
GUIDE
When to use base64 images
Best for small, critical assets
Data URIs remove an HTTP request entirely, which helps for small logos, icons, and above-the-fold visuals. A few kilobytes inlined is a win; megabytes inlined delay first paint because they ship inside the HTML or CSS itself.
Cache and compression trade-offs
External images are cached independently and compress well; base64 inflates bytes by about 33% and re-downloads with every HTML refresh. Use it where requests cost more than the size increase.
Format matters
PNG for graphics and transparency, JPEG for photos, WebP when every consumer supports it. If the encoded size surprises you, try resizing the source first with the companion image resizer.
HELP / FAQ
Image to base64 questions
Why is my base64 33% bigger than the file?
Base64 packs 3 bytes into 4 characters, so binary payloads always grow by about a third. That is the standard encoding, not an error.
Where do I paste the data URI?
Almost anywhere an image URL is accepted: CSS background-image, an img src, a favicon link, or fetch(). The tool emits ready-made snippets for the common cases.
Is this safe for email templates?
Many email clients block remote images but accept data URIs, so embedding small banner images inline improves deliverability of the visuals. Test in your target clients first.
Does the file get uploaded?
No. The browser reads the file with the FileReader API and encodes it in this tab.
EXPLORE BY CATEGORY · BFOTKIT
More tools like this
Pick a category to see every tool in it — then open one and discover related tools.