Data URIs with copy-ready snippets
Base64 encoding turns an image file into a plain text string that can live directly inside HTML, CSS, JSON, or source code as a data URI. This tool reads your image in the browser and hands you that string four ways: raw, wrapped in an <img> tag, as a CSS background-image, and as a Markdown image, each with its own one-click copy button.
Nothing is uploaded. The conversion is a local file read, which is why it is instant even for large files and why there is no usage limit.
When Base64 is the right tool, and when it is not
Inline data URIs shine for small assets where an extra HTTP request costs more than the bytes save: icons, tiny logos, single-use decorations in an email template, or images embedded in JSON payloads and userscripts. They are the wrong tool for anything big: Base64 adds roughly 33 percent to the file size, the string cannot be cached separately from the document, and a multi-megabyte URI will make editors and browsers crawl.
A good rule: inline below about 10KB, serve as a file above it. If your image is heavy, shrink it first with the free image compressor or convert it to WebP with the free image converter, then encode the smaller file here.
What to expect
The data URI preserves your file byte for byte; nothing is re-encoded, so quality is untouched and the MIME type in the URI matches the original format. The tool accepts JPG, PNG, WebP, AVIF, GIF, and more. The size overhead is shown after conversion, so you can judge immediately whether inlining makes sense.