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.

Remove unnecessary whitespace:

Clean up extra spaces, tabs, and line breaks in your SVG code. This reduces file size and can improve rendering performance, especially for inline SVGs.

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.