SVG to Base64 String

Copy the raw Base64 string — no data: prefix

Full data URI? SVG to Base64 data URIHub? SVG to Base64

FAQ

Quick answers

How do I get a Base64 string from SVG?
Paste the SVG and click Copy Base64 string. You get PHN2Zy… characters only — no data:image prefix.
When do I want the string instead of a data URI?
Use the raw string when an API, JSON payload, or custom header already adds the MIME type for you.
Does the sample include width and height?
No. Root width and height are omitted so the encoded string does not bake in fixed pixel size.
Need the data URI wrapper?
Open SVG to Base64 Data URI to copy data:image/svg+xml;base64, plus the same string.
SVG to Base64 → SVG image to Base64 string → SVG to Base64 data URI → SVG to Base64 CSS →
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