Image to Base64
Convert an image to a Base64 data URI and get ready-made HTML, CSS and Markdown snippets — fully in your browser.
About Image to Base64
Base64 encoding makes a file about 33% larger, and the resulting string can't be cached separately by the browser — so a data URI only pays off for small images like icons, logos, or background patterns. This tool reads the image entirely inside your browser, builds the data: string, and hands you ready-to-paste snippets for <img>, CSS background-image, and Markdown. Nothing is uploaded.
How to use Image to Base64
- 1
Drop an image into the box, or click it to pick a file.
- 2
Check the stats table for the original size, data URI length, and percentage size increase.
- 3
Watch the warning — if the string is too large, link the file instead of inlining it.
- 4
Copy the snippet you need — <img>, background-image, or Markdown — with one click.
Frequently asked questions
How large can a data URI be?
Modern browsers have no hard limit and handle multi-megabyte URIs, but old IE capped them at 32 KB. Practically, keep data URIs under a few KB: base64 adds ~33% and the image can't be cached on its own, so large photos are better linked than inlined.
Is my image uploaded anywhere?
No. Conversion runs locally with the browser's FileReader; the file never leaves your device.
Why is the data URI bigger than the original file?
Base64 turns every 3 bytes into 4 characters, a ~33% overhead, plus a short data:...;base64, header prepended to the payload.
Should I base64-encode SVGs?
Not necessarily. SVGs also work as URL-encoded data URIs (no base64), which is usually smaller and stays human-readable. This tool base64-encodes everything for format-agnostic reliability.