Skip to content
ZeroServer.tools

SVG to Data URI

Encode an SVG into a URL-encoded or base64 data URI for CSS or img src.

Preview
SVG preview
URL-encoded (recommended for CSS)
Base64
CSS background

Inlining SVG as a data URI

A data URI embeds an entire SVG directly into your CSS or HTML, removing a network request — perfect for small icons, backgrounds, and bullets. The URL-encoded form is usually smaller and more readable than base64 and is the recommended choice for CSS background-image; the base64 form is handy when a tool requires it. Both are generated locally — your SVG never leaves your browser.

Working with raster images or other strings? The Base64 encoder and URL encoder cover the general cases.

Related Converters tools