Skip to content
DDevToolery

Data URI Generator

Turn a local file into an inline data: URI.

Loading tool…

About this tool

Produces a data URI that embeds a file directly in HTML or CSS, removing one network request. Worth it for assets of a few hundred bytes; a losing trade above a few kilobytes, since the asset can no longer be cached separately or fetched in parallel.

Limitations

  • Data URIs cannot be cached separately from the document that contains them. Past a few kilobytes a normal file request usually wins.

Questions

Should I inline this image?
Under about a kilobyte and used on every page, probably. Larger than that, almost certainly not — over HTTP/2 an extra request costs very little, while a large inlined asset is re-downloaded whenever the file containing it changes.

Privacy

This page does its work in your browser. What you paste is processed by JavaScript running on your own device and is never sent to a DevToolery server — there is no server that could receive it. The page itself is a static file delivered by a CDN. See exactly what is stored.