Image to Data URI
Encode an image as a base64 data: URI ready to paste into HTML <img src>, CSS background-image, or Markdown. One-click copy. Runs locally — nothing is uploaded.
100% client-side · no upload
Raw data URI
HTML <img> snippet
CSS background-image snippet
Pick an image to encode.
How to use the data URI
- Pick an image — JPG, PNG, GIF, WebP and SVG are all supported.
- Copy the snippet you want — raw URI, HTML
<img>, or CSSbackground-image. - Paste it directly into your code. No external file needed.
Common use cases
- Inlining small icons (favicons, buttons) in HTML or CSS to remove HTTP requests.
- Embedding a logo into a self-contained
.htmlfile for email or offline distribution. - Pasting screenshots into Markdown notes that travel as a single file.
Frequently asked questions
What size is the data URI compared with the original?
Base64 inflates the byte length by roughly 33%. We display both sizes after encoding.
Is there a size limit?
Browsers usually accept data URIs up to several megabytes, but performance suffers. For images above ~50 KB, keep the file external instead.
Does it expose private images?
No — the encoding is local. Be aware that anywhere you paste the data URI, anyone with access to that file can decode the image.
Related: WebP to PNG · PNG to JPG · SVG to PNG · All image converters