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.

Choose a file or drop it hereUp to 2 MB. Small files (under 10 KB) work best.
0Original
0Data URI
0Overhead

Runs entirely in your browser. Your input and files are not uploaded to any server.

How to use

  1. Choose a small file (ideally under 10 KB).
  2. Pick Base64 or, for SVG, URL-encoded text.
  3. Copy the data URI or a ready-made CSS/HTML snippet.

Examples

CSS background

background-image: url("data:image/svg+xml,…") for a 600-byte icon.

Email signature

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.

Related tools

All File Utilities
SVG Preview & OptimizerPreview SVG files safely and shrink them by removing comments, editor metadata and whitespace, with optional number rounding.
Favicon GeneratorGenerate a complete favicon set from an image or a letter: favicon.ico, 16–512 px PNGs, Apple touch icon, web manifest and HTML tags, in one ZIP.
CSV CleanerClean CSV files in your browser: trim cells, remove empty and duplicate rows, change the delimiter and preview the table before downloading.

Search tools