A data URI lets you inline an SVG directly in CSS or HTML, with no separate file and no extra request. This converts the SVG above into a data: string — URL-encoded by default, because that's smaller for SVG, or base64 when you need it. The conversion runs in your browser, so the file never leaves your machine.
How to convert an SVG to a data URI
- Load your SVG above, or edit the sample. It stays in your browser.
- Open the Code tab and choose Data URI.
- Keep URL-encoded for the smallest string, or switch to base64.
- Copy the string straight into your CSS or HTML.
Where an inline SVG fits
- A CSS background —
background: url("data:image/svg+xml,…")— the classic case, with no HTTP request for the icon. - An
<img src='data:…'>or amask-image. - Design tokens and CSS-in-JS, where the icon lives beside the styles that use it.
URL-encoded vs. base64
URL-encoding percent-escapes only the characters that would break the URI and leaves the rest readable, so for an SVG it is meaningfully smaller than base64 — which is why it's the default here. Base64 wraps the whole file in an ASCII envelope: larger, but a handful of contexts prefer it, so toggle to base64 when URL-encoded doesn't take. Either way the inline svg renders identically; the choice is about size and compatibility, not appearance.