File to Data URI
Data URIs let you embed a small file directly in CSS or HTML, saving a request for tiny icons. They are about 33% larger than the original and cannot be cached separately, so this tool warns you when a file is too big to inline. SVGs can also be encoded as URL-escaped text, which is often smaller than Base64.
Runs entirely in your browser. Your input and files are not uploaded to any server.
How to use
- Choose a small file (ideally under 10 KB).
- Pick Base64 or, for SVG, URL-encoded text.
- Copy the data URI or a ready-made CSS/HTML snippet.
Examples
background-image: url("data:image/svg+xml,…") for a 600-byte icon.
Some email clients block data URIs — test before relying on them.
Privacy
Your files and text stay in your browser while you use this tool, and ads or anonymous visit statistics do not receive them. Only your favorites and recent tools are saved on your device. Privacy policy
Want proof? Check it with your browser’s Network tab: How to check that a tool does not upload your files
Frequently asked questions
When should I not use a data URI?
For files over about 10 KB, for images used on many pages (a normal file can be cached once), and for anything that changes often.
Is the file uploaded?
No. It is read and encoded in your browser.