Image to Base64

Drop an image, get a data URI you can paste into a stylesheet or an <code>img src</code>. File never leaves the tab.

Data URI
—
Encoded size
—
Original size
—
Preview

Worked example

Base64 adds about 33% to the file size, and the resulting string cannot be cached separately from the document it lives in. Worth it below roughly 2 KB; a net loss above about 10 KB.

A data URI inlines the file into the document. That removes one HTTP request per image, which matters for tiny icons on a cold cache, and it makes the file impossible to cache independently, which hurts everything else.

When inlining is the right call

Icons under a couple of kilobytes, images that must render before any network round trip, and email templates where external images are blocked by default. For photographs and anything reused across pages, a separate file with a long cache lifetime is faster overall.