Skip to content

Image to Base64

Data URI plus HTML, Markdown and CSS snippets.

Drop an image here, paste with Ctrl+V, or choose a file JPEG, PNG, WebP, GIF, AVIF and other formats your browser can open. Your files stay in this browser.

Embed an image as text

A Base64 data URI turns an image into a text string that can sit inside HTML, CSS, JSON or an email template, so the page needs no separate image request. This tool encodes the file and gives you ready-to-paste snippets for an HTML <img> tag with width and height, Markdown, BBCode and a CSS background-image rule.

When to use it, and when not to

  • Good for small icons, tiny logos and placeholders under a few KB.
  • Base64 text is about 33% larger than the file, cannot be cached separately and blocks the page while it parses. For anything bigger, a hosted link loads faster.
  • Opened from an imgly image, the tool also shows hosted-link snippets, which are the better choice for most pages.

Shrinking first

Choose Shrink first to resize and re-encode as WebP, JPEG or PNG before encoding, and the size readout updates as you change settings. Many forums and chat apps strip data URIs from BBCode and Markdown, so test the snippet where you plan to use it.

Privacy: the image stays in your browser while you work. Nothing is uploaded unless you press Host on imgly, which opens the upload page with your result ready to post.

More image tools

Report