Small SVG icons and background patterns are often best inlined directly into your CSS as a data URI, removing an extra network request. This converter takes raw SVG markup and produces both encodings — an optimized URL-encoded data URI and a Base64 one — with the byte size of each so you can pick the smaller.
URL-encoded vs Base64
URL-encoded : data:image/svg+xml,%3Csvg ... %3E (smaller, readable)
Base64 : data:image/svg+xml;base64,PHN2Zy... (~33% larger)
For almost every SVG the URL-encoded form is smaller because SVG is text and
Base64 always adds roughly a third to the size. The tool escapes only the
characters that would break inside a url("...") value — <, >, #, %,
and the braces — and converts double quotes to single quotes so the string is
safe to drop into a stylesheet.
Using the result
.icon {
background-image: url("data:image/svg+xml,%3Csvg .../%3E");
background-repeat: no-repeat;
}
Copy the CSS rule button gives you exactly this, ready to paste. Everything runs locally in your browser — the SVG you paste is never uploaded.
When not to inline
Inlining is a win for small icons and repeating patterns. For large, detailed SVGs — or any SVG reused across many pages — a separate file that the browser can cache once is usually the better choice, since an inlined data URI is re-downloaded with every stylesheet that contains it.