SVG to CSS Data URI Encoder

Convert SVG markup into a URL-encoded CSS data URI for background-image, plus a base64 variant — with a live preview. Encodes #, <, > and quotes correctly. 100% in-browser; your SVG never leaves your machine.

Runs in your browser Nothing uploaded Free, no signup

Everything stays in this browser

SVG to CSS Data URI Encoder: questions

Why URL-encode instead of base64?
URL-encoded SVG is usually smaller, stays human-readable, and gzips better. Base64 inflates size by about 33% but is sometimes needed for older tooling.
Which characters must be encoded?
At minimum # (would be read as a fragment), <, >, and double quotes. This tool encodes them all and swaps double quotes for single quotes to keep the output compact.

Made something with AI? Share it as a private link.

Drop in the HTML from Claude, ChatGPT or any editor and get a link your client can open anywhere — with a password, view tracking, comments and approval.