A data URI saves a request for small icons, but it cannot be cached separately and grows the CSS file. Keep it for graphics under a few kilobytes.
About the SVG to Data URI
The SVG to Data URI converter embeds vector graphics directly in a stylesheet or HTML file. Paste the SVG and get a URI plus copy-ready CSS and image snippets, with a preview to confirm it renders.
Embedding small icons this way removes a network request, but each URI is duplicated wherever it appears. Base64 output grows by roughly a third, so check the file size afterwards.
- ✓URL-encoded and Base64 modes
- ✓Live rendering preview
- ✓CSS and HTML snippets included
How to use the SVG to Data URI
- 1
Paste the SVG markup.
- 2
Choose URL-encoded or Base64 output.
- 3
Copy the URI, CSS, or img tag.
Frequently asked questions
Which encoding should I choose?+
URL-encoded output is usually shorter and easier to read. Base64 is safer when the SVG contains characters your CSS pipeline escapes badly.
Can I animate an embedded SVG?+
Not with CSS animations inside the data URI in most browsers. Inline the SVG in the document when you need scripted or animated behaviour.
Save SVG to Data URI to your favorites, or keep browsing converters.
Browse all 45 converters →