Convert SVG to CSS Data URI

Instantly convert SVG markup into percent-encoded or base64 Data URIs for cleaner, faster CSS.

Input SVG

Conversion options

Conversion Output

Ready to convert your SVG?

Paste your SVG markup in the form and click Convert to begin.

Group related elements:

Use <g> tags to group related SVG elements. This allows you to apply transforms, styles, and animations to multiple elements at once, keeping your code organized and maintainable.

Why Use SVG Data URIs?

An SVG Data URI embeds the entire SVG directly into CSS or HTML. This eliminates external requests, leading to faster loading times for your website icons and graphics. It is crucial for modern performance scores.

Percent-Encoded vs. Base64

Percent-Encoded (Recommended)
Generally smaller and preferred for CSS injection. It replaces reserved characters (like #, <, >) with their hexadecimal equivalents (e.g., %23, %3C).
Base64
Converts the binary data into an ASCII string. While universally compatible, it can be 20-30% larger than the percent-encoded version.
Switch to privacy-first site stats — Koko Analytics for WordPress.