SVG to CSS Background
Paste SVG markup below.
">
Paste SVG and get a CSS background-image rule with the SVG encoded as a data URI. No extra HTTP request, no image file to host.
Paste SVG markup below.
The SVG is collapsed to one line and URL-encoded with encodeURIComponent, so characters like # and quotes cannot break the CSS. The result is wrapped in a .svg-background rule with background-repeat, background-size and background-position set to sensible defaults.
Data URI backgrounds need no extra request and no image hosting, which is perfect for icons, patterns and decorative shapes. They also scale crisply at any size because the source stays vector.