SVG to CSS Data URI Generator
Convert vector SVG markup into optimized URL-encoded CSS background-image, Base64 Data URIs, HTML image tags, and React JSX components.
Why URL Encoding is Superior to Base64 for SVG
Base64 increases the file size of plain-text SVGs by roughly 33%. URL encoding (using data:image/svg+xml;utf8,... with encoded #, %, and ") maintains vector readability and gzip compressibility while keeping payload sizes minimal.
Frequently Asked Questions
#) designates an anchor or fragment identifier. To use hex colors in a data URI, you must URL-encode the symbol as %23 (e.g. fill='%23ff0000'). This generator encodes hashes automatically.