Skip to content
๐Ÿ”—

Data URI Generator

Developer

Encode any file or text as a data URI for embedding in HTML, CSS, or XML.

0
0
Text
Data URI
data:text/plain;base64,

An external image or font file means an extra HTTP request before a page can fully render it, and for something small, a tiny icon, a background pattern, a custom font file, that round trip is often unnecessary overhead a data URI avoids entirely by embedding the file's actual bytes directly into the HTML, CSS, or XML that references it. This tool encodes any file or text as a complete data URI, with the correct MIME type prefix already attached, ready to paste straight into a src attribute or a CSS url() function rather than left as a raw, unlabeled base64 string.

See more about the Data URI Generator

Useful for embedding a small icon directly inside a CSS file so it loads with zero extra requests, inlining a custom font for an email template that can't reference external files, or turning any file into a single copyable string for pasting into source code.

Key features

  • Clean interface
  • Fast processing
  • No signup required
  • Works offline

Quick answers for Data URI Generator

What MIME types can I choose for text input?
text/plain, text/html, text/css, application/javascript, application/json, and image/svg+xml.
Does uploading a file send it anywhere?
No, files are read and base64-encoded entirely in the browser using the FileReader API, nothing is uploaded to a server.
Can I preview an image before copying its data URI?
Yes, if the uploaded file is an image type, a thumbnail preview renders using the generated data URI directly.