About this tool
Paste raw SVG markup and get a data URI you can drop straight into CSS or HTML. It produces two encodings and everything is generated in your browser, so nothing is uploaded.
The URL-encoded output swaps double quotes for single quotes, runs encodeURIComponent, then restores a few safe characters (space, colon, slash, equals) to keep it compact and human-readable. The base64 output UTF-8 encodes the SVG and runs it through btoa, giving data:image/svg+xml;base64,… . A byte comparison shows which encoding is smaller; for most icons the URL-encoded form wins.
Enable minify to strip comments and collapse the whitespace between tags before encoding. Copy the background-image line for CSS or the <img src> line for HTML. Note that quotes inside the SVG are normalised to single quotes so the data URI can be wrapped in double quotes safely.