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
Ctrl + Enter to run · Recent brings back your last inputs · 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.
Related tools
All 112 free tools
CSS Minifier & BeautifierCompress or format CSS
SVG OptimizerMinify and clean SVG markup
Website Accessibility AuditCrawl a page for WCAG risks
CSS Grid GeneratorVisual grid layout builder
CSS Flexbox GeneratorBuild flexbox layouts visually with live preview
Color Palette GeneratorPalettes from one color
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.