Web Tools
Data URL Generator
Convert text content to data: URIs with configurable MIME type, encoding (Base64 or percent-encoded), and charset. Instantly generate embeddable data URLs for SVGs, CSS, HTML, JSON, and more. Runs entirely in your browser — your data never leaves your machine.
data-url base64 encoding embed uri mime
Published May 31, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Enter text content, select a MIME type and encoding method, and the tool instantly generates a data: URL. Base64 encoding produces compact URLs for binary-safe embedding, while percent-encoding is better for human-readable content like SVG. The generated URL can be used in <img src>, <link href>, CSS url(), iframe src, and anywhere a URL is expected.
Features
- 9 MIME types: text/plain, HTML, CSS, JavaScript, JSON, XML, SVG, CSV, Markdown
- 2 encodings: Base64 and percent-encoded (RFC 3986)
- Custom charset: configurable charset parameter (default utf-8)
- Live stats: input byte size, output URL length, MIME type, encoding
- UTF-8 safe: handles multi-byte characters (emoji, accented chars) correctly
- 5 examples: plain text, inline SVG, CSS, JSON, HTML fragment
- Private: all computation runs in your browser — no data transmitted
Use Cases
- Embedding small SVG icons directly in CSS
background-image: url(data:...) - Inlining critical CSS in HTML
<link>tags for faster first paint - Creating self-contained HTML pages with embedded resources
- Generating data URLs for test fixtures and mock data