SVG to Base64 Data URI

Copy data:image/svg+xml;base64,... ready for src or url()

HTML img? SVG to Base64 HTML imgRaw string? SVG to Base64 string

FAQ

Quick answers

What is an SVG Base64 data URI?
It is the SVG file encoded as Base64 after data:image/svg+xml;base64, so a browser can treat the string as an image without a separate file.
How do I convert SVG to a Base64 data URI?
Paste the sample or your markup, then click Copy Base64 data URI. The Data URI tab stays on Base64 encoding.
Why is there no width or height on the sample?
viewBox alone lets the image scale when you set CSS width/height on the host element. Fixed root size would fight that.
Want an HTML img tag around it?
Use SVG to Base64 HTML Img to copy a complete <img src="data:…"> snippet.
SVG to Base64 → SVG Base64 data URI image → SVG to Base64 HTML img → SVG to Base64 string →
Open full editor →

Source

Type or paste SVG markup. The preview on the right updates as you type.

Ready

Live preview

PNG export · 2× for retina