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

Your files and text stay in your browser while you use this tool, and ads or anonymous visit statistics do not receive them. Only your favorites and recent tools are saved on your device. Privacy policy

Want proof? Check it with your browser’s Network tab: How to check that a tool does not upload your files

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