Image to Data URI
Convert an image into a Base64 data URI for inlining in CSS or HTML.
Preview
Data URI
Snippets
When to inline an image
A data URI embeds an image directly in your CSS or HTML as Base64 text, so the browser doesn't make a separate request for it. That's useful for tiny, frequently used assets — icons, a 1px background, an email signature logo — where avoiding an extra round-trip is worth it, and for self-contained files that must work offline.
The trade-offs
Base64 makes the data about 33% larger and it can't be cached separately from the file it's embedded in, so inlining big images bloats your CSS/HTML and hurts performance — keep it to small assets (a few KB). SVGs are often better inlined as markup than as a data URI. Everything here is encoded locally; your image never leaves your device.
These calculators run entirely in your browser — nothing you type is sent anywhere. Results are estimates for planning; validate against your vendor's documentation before you buy or deploy.