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
Runs entirely in your browser. Your input and files are not uploaded to any server. See the privacy policy for what is stored in your browser (favorites and history only). Privacy policy
Check it yourself: open your browser’s developer tools, select the Network tab and use the tool. Your file never appears in an upload request. Once this page is saved for offline use, you can also disconnect from the internet and keep working. Ads and anonymous visit statistics, when enabled, make their own requests, but they never receive your files or text.
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.