Data URI Generator
Free online Data URI generator tool, convert files to Base64
šClick or drag & drop a file to generate Data URISupports images, fonts, SVG, PDF, and more
What are Data URIs?
A Data URI embeds file data directly into a URL using the format data:[mimeType];base64,[data]. This allows you to embed small images, fonts, or files directly in HTML, CSS, or JavaScript without external file references. Data URIs eliminate extra HTTP requests for small resources.
How to Generate Data URIs
Upload a file (image, font, SVG, etc.). The tool generates the Data URI string. Use Copy as CSS to get a background-image property, or Copy as HTML for an <img> tag. Data URIs work best for files under 10KB.
ā¶When should I use Data URIs vs external files?
Use Data URIs for small resources (under 10KB) like icons, tiny images, or fonts. For larger files, external files with caching are more efficient. Too many Data URIs in CSS can slow down rendering.
ā¶Do Data URIs work in all browsers?
Yes, all modern browsers support Data URIs. Very old browsers (IE8 and below) have a 32KB size limit, but this is not relevant for modern applications.