Paste SVG code, get a base64 or URL-encoded data URI plus a ready-to-paste CSS snippet — instantly, in your browser.
Load example
The encoded string only, without the data: prefix.
Ready to drop into an <img src>, href, or fetch() call.
Paste directly into a stylesheet — no external file request.
Base64-encoding an SVG doesn't need a server round trip —
it's a deterministic string transform the browser can do
natively. This tool runs TextEncoder and btoa (for base64) or encodeURIComponent (for the
URL-encoded variant) directly on your pasted markup, so the
result appears as you type with zero network latency and zero
risk of your SVG being logged somewhere.
Embed a small icon directly in a stylesheet without a separate HTTP request.
Some email clients block linked images but render data URIs — useful for small inline glyphs.
Bundle an icon directly into a JS/JSX string or a design-token file with no build step.
Use a tiny inline SVG as an instant placeholder before a real image loads.
Data URIs work as mask sources too, for CSS-driven icon coloring.
Paste a working icon straight into a CodePen, email template, or static HTML file.
Clean up the SVG first with the SVG optimizer to keep the encoded string as small as possible, recolor it with the SVG color editor, or convert it into a React/JSX component instead of a data URI if you're working in a component-based framework.
data:image/svg+xml;base64,... URI, and a CSS snippet — all client-side, nothing is uploaded.background-image: url("data:..."), avoiding an extra HTTP request.data:image/svg+xml,%3Csvg...) is usually 10–20% smaller than base64 for SVG specifically, because SVG is already text and only a handful of characters need escaping. Base64 is more universally recognized and safer when the SVG contains many special characters. Both are valid and supported by all modern browsers — this tool gives you both.src of an <img> tag, as a CSS background-image, or inside url() in an @font-face or mask declaration.<img src="icon.svg"> or SVG sprite may load faster overall.TextEncoder and btoa APIs (for base64) and encodeURIComponent (for the URL-encoded variant). Your SVG markup never leaves your device.