Data URI Converter – Encode Files as Data URIs
Convert files to Data URI format for inline embedding in HTML, CSS, or SVG—supports images, fonts, and other file types offline.
Data URI Converter
Convert text and files to Data URIs
Converted output will appear here
lightbulbPopular Use Cases
Embed SVG images directly in HTML/CSS without external file dependencies
Convert tiny icons and favicons to Data URIs for single-file HTML pages
Use Data URIs in CSS for background patterns without HTTP requests
Embed custom fonts in CSS using Data URIs for better offline support
scienceExamples
Convert plain text to base64 Data URI
Auto-detect JSON and create Data URI
keyboardKeyboard Shortcuts
keyboardShow shortcutsexpand_more
Related tools
Show moreShow more
› About this tool · FAQ
Stop managing separate asset files! Convert text, images, and files to Data URIs for inline embedding in HTML, CSS, and JavaScript. Base64 encoding, automatic MIME type detection, and comprehensive format support. Perfect for single-file distributions and embedded resources. Free, works offline, unlimited conversions.
How do I convert to Data URI?
Paste your text or upload a file, select MIME type (or use auto-detection), choose encoding (base64 recommended), and convert. The tool generates a data: URL instantly for embedding in HTML, CSS, or JavaScript.
Is this Data URI converter free?
Yes, completely free with unlimited conversions. No signup required, no watermarks. All conversion happens in your browser for complete privacy of files and embedded resources.
Are files uploaded to servers?
No, all Data URI conversion happens locally in your browser. Files never leave your computer, ensuring complete privacy for images, assets, and proprietary resources.
What is a Data URI and when should I use it?
A Data URI embeds file content directly in a URL using the data: scheme. Use it for small files (< 10KB) to reduce HTTP requests, create self-contained documents, or embed resources inline.
What's the difference between base64 and percent encoding?
Base64 is more compact for binary data and images, while percent encoding is human-readable for text. Base64 increases size by ~33%, while percent encoding varies based on special characters.
Why does my Data URI make the file larger?
Data URIs have encoding overhead. Base64 adds ~33% size, plus MIME type headers. For small files, this is acceptable to avoid HTTP requests, but large files should use separate URLs.
How does MIME type auto-detection work?
The tool analyzes content patterns: JSON structure, HTML/XML tags, CSS syntax, JavaScript keywords, and binary signatures for images. Manual override is available for accuracy.
Are there size limits for Data URIs?
Browsers typically support 2-32MB Data URIs, but performance degrades significantly above 100KB. Keep Data URIs small (< 10KB) for best practices and avoid them for large media files.