One file, one data URI
The tool reads the image with the FileReader API and returns the full data URI: the MIME type, a base64 marker and the encoded bytes. It does not re-encode, resize or compress, so the embedded image is byte-for-byte the file you selected. That makes it reliable for tiny icons, email signatures and CSS backgrounds where the exact pixels matter.
How much bigger does it get
Base64 uses four characters to carry three bytes, so the text is about 33% longer than the binary file. A 30 KB PNG becomes roughly 40 KB of characters before any quoting overhead. The panel shows the original size, the URI length and the percentage increase, and a warning appears once the URI passes 10,240 characters because long data URIs are hard to read and slow to paste.
Ready-to-paste snippets
Alongside the raw URI the tool builds an HTML image tag and a CSS background rule with the URI already substituted. The class name in the CSS snippet is derived from the file extension, so icon.png becomes a rule named after png. Copy buttons sit next to each output.
Where it stops
- There is no automatic minification; embedding a photograph will produce an enormous string and a poor page.
- Selecting the same file twice in a row does not fire a change event, so choose another file or reload first.
- The clipboard call has no fallback and fails silently outside a secure context.
- No size cap and no warning above the 10 KB threshold beyond the amber note.
Questions people ask
Should I inline every image?
No. Inline only small, frequently used assets. Large data URIs block HTML parsing and cannot be cached separately.
How do I decode a data URI back to a file?
Use the base64 to image tool. For text rather than files, the base64 encoder is the general-purpose version.