Data URI Generator
Free online Data URI generator tool, convert files to Base64
About Data URI Generator
Encodes any uploaded file into a base64 data URI (data:<mime>;base64,...). It detects MIME type from the file extension (png, jpg, gif, svg, webp, bmp, ico, pdf, json, xml, html, css, js, txt, csv — anything else falls back to application/octet-stream) and shows original size, URI length, and a copyable snippet. For image files it also renders a preview.
How to Use
1. Click the drop zone or drag a file onto it. 2. Review the File Info card (name, MIME, original size, data-URI size) and, for images, the preview. 3. Use Copy to copy the raw data URI, Copy as CSS to get background-image: url("...");, or Copy as HTML to get an <img> tag (images only).
Size Warning & MIME Notes
Base64 encoding inflates size by roughly 33%, so large files produce very long strings that may slow down browsers, editors, or build tools. The MIME lookup is extension-based; if the file has no extension or an unknown one, it defaults to application/octet-stream.
▶Is there a file size limit?
▶Why does the MIME type show application/octet-stream?
▶What do the CSS and HTML copy buttons produce?
▶Are files uploaded anywhere?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee