Data URI Generator
Turn text or a small local file into a complete Base64 or percent-encoded data URL, then copy the raw URI or a ready-to-use CSS or HTML snippet.
Turn text or a small local file into a complete Base64 or percent-encoded data URL, then copy the raw URI or a ready-to-use CSS or HTML snippet.
A data URI, also called a data URL, includes a media type and the resource bytes directly in the URL instead of pointing to another file. Its general shape is data:[media-type][;base64],data.
Data URLs are useful for small test fixtures, tiny icons, generated downloads, self-contained examples, and CSS resources where an extra file would be inconvenient. They are usually a poor choice for large assets because Base64 increases the encoded size, repeated data cannot be cached as a separate resource, and long strings are harder to inspect and maintain.
The text Hello, MiniUtil! can be represented as:
data:text/plain;charset=UTF-8,Hello%2C%20MiniUtil!
or with Base64:
data:text/plain;charset=UTF-8;base64,SGVsbG8sIE1pbmlVdGlsIQ==
Percent encoding keeps short readable text relatively understandable. Base64 is the appropriate option for arbitrary file bytes. The browser-reported file media type is used when available, and you can override it when the source lacks a useful type.
Data URLs inherit the security behavior of the context where they are used. Do not embed untrusted active HTML or script content. Content Security Policy can restrict which resource types may load from the data: scheme, and permitting data: broadly can increase risk.
This generator limits text to 1 MB and files to 5 MB. Those limits prevent accidental browser freezes; they do not mean a multi-megabyte data URL is a good production choice. Check the output length and test it in the actual consumer because applications can impose their own URL limits.
Use the Base64 Encoder when you need only encoded text rather than a complete URL. Build a safer embedding policy with the CSP Header Builder, or create an HTTP download name with the Content-Disposition Generator.
File bytes and text stay in the browser. No upload or remote conversion occurs, and generated content is not recorded in analytics.
The syntax and intended use for small values are defined by RFC 2397.
Share this utility
Send the tool, not any text or files you entered. Input is never added to the share URL.
Keep working