⚡ How It Works
Encodes SVG code as Base64 or URL-encoded Data URI. Base64 uses btoa() to encode; URL-encoding percent-escapes special characters. Both produce inline resources.
💼 Use Cases
Embed SVG icons in CSS to avoid extra HTTP requests; display SVGs directly in HTML; create single-file HTML pages; embed SVGs in Markdown.
❓ FAQ
❓ What is a Data URI?
A Data URI embeds resources like images and fonts directly into HTML or CSS. Format: data:[mime-type];[encoding],[data]. It reduces HTTP requests.
❓ Which output formats are supported?
Two encoding modes: Base64 (for CSS background-image,
![]()
src) and URL-encoded (for inline SVG in HTML).
❓ Does SVG size increase?
Base64 adds about 33% overhead, URL encoding adds ~5-15%. Use Base64 for small icons, external files for large SVGs.
❓ Can I use it in CSS?
Yes. The Data URI works in CSS background-image and content properties, compatible with all modern browsers.
❓ Is this tool free?
Yes, completely free. No registration or payment required.