Data Uri Generator
Convert small files into embeddable Base64 Data URIs with the Data URI Generator. Upload a file from your device and generate a Data URI for use in HTML, CSS, JavaScript, and other web projects.
Data URI Generator
Drop your file here
or choose a file from your device
Images, SVG, CSS, JavaScript, HTML, JSON, XML, TXT, fonts and moreWhat Is a Data URI?
A Data URI is a way to embed file data directly into a URL instead of referencing a separate external file. The data is typically encoded as Base64 and can be used for resources such as images, fonts, CSS, and other small files.
For example: dattext/plain;base64,SGVsbG8gV29ybGQ=
This represents text data encoded directly inside the URI.
How to Generate a Data URI?
Open the Data URI Generator: Use the tool to convert a local file into an embeddable Data URI.
Choose Your File: Drag and drop a file into the upload area or click Browse File to select one from your device.
Select a Supported File: The tool supports images, SVG, CSS, JavaScript, HTML, JSON, XML, TXT, fonts, and other file types.
Generate the Data URI: After uploading, the tool processes the file and converts its contents into a Data URI using the appropriate encoding.
Use the Result: Copy the generated URI and use it where an inline or embedded resource is supported.
Data URI Example:
Input: Hello World
Output: dattext/plain;base64,SGVsbG8gV29ybGQ=
Where Can Data URIs Be Used?
HTML
Data URIs can be used directly in HTML attributes such as an image source:
<img src="datimage/png;base64,..." alt="Image">
CSS
Small assets can be embedded directly inside CSS:
background-image: url("datimage/png;base64,...");
JavaScript
A generated Data URI can also be used by JavaScript when working with supported data URLs.
Frequently Asked Questions
No FAQs available for this tool.