File to Data URI
Turn a small file into a base64 data URI you can paste into CSS or HTML, with copy-ready snippets and an honest size comparison.
What it does
File to Data URI reads the whole document before doing anything, so what comes back is either valid output or a specific error with the position that caused it — not a partially rewritten file.
When you need it
Usually when something has already gone wrong: a config file an application will not load, an API response that has to be read by a human, or an export that has to be checked before it goes anywhere near a database.
Limits and caveats
Key order is preserved as it appears in the input. Very large documents are limited by your device's memory rather than by an upload cap, since the parsing happens locally. Everything happens in your browser, so the file never leaves your device.
How to file to data uri
- Drop a small file — an icon, a font subset, a logo.
- Copy the URI, or the ready-made CSS or HTML line.
- Check the size comparison before you commit to it.
Frequently asked questions
- When is inlining actually worth it?
- For files of a few kilobytes that are needed immediately — a logo in the header, an icon in a critical stylesheet. You trade one request for a bigger document.
- Why does the file get bigger?
- Base64 encodes three bytes as four characters, so about a third is added. On top of that, an inlined file can't be cached separately from the document that carries it, so it is re-downloaded whenever that document changes.
- Do my files get uploaded?
- No. This tool runs entirely in your browser, so the file never leaves your device.