Convert SVG markup into an optimized CSS background-image data URI, URL-encoded or Base64, with a live preview. Free online SVG to CSS tool.
Turn SVG markup into a CSS background-image data URI. URL encoding keeps the result short and readable; Base64 is also available.
URL-encoded SVG is usually smaller and stays readable. Base64 is safer in tools that mishandle special characters.
SVG used as a data URI needs xmlns="http://www.w3.org/2000/svg" to render, so it is added when missing.
Yes. Line breaks and extra spaces between tags are collapsed to shorten the result.