SVG to Base64 HTML

Copy an <img> whose src is a Base64 data URI

Img-focused? SVG to Base64 HTML imgData URI only? SVG to Base64 data URI

FAQ

Quick answers

How do I embed SVG as Base64 in HTML?
Paste the SVG and click Copy Base64 HTML. The snippet is an img tag with a data URI src.
Why img instead of inline <svg>?
A data URI img is one attribute — useful in CMS fields, emails that allow data URIs, or when the host only accepts an image URL.
Does the img keep SVG sharpness?
Yes at any CSS size, because the payload is still vector. Set width/height on the img, not on the root SVG.
Need the img wording more specific?
SVG to Base64 HTML Img uses the same snippet with img-focused copy.
SVG to Base64 → SVG to Base64 HTML img → SVG to Base64 data URI → 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