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.

Always include a viewBox:

The viewBox attribute (e.g., viewBox="0 0 24 24") makes your SVG scalable and responsive. Without it, SVGs may not scale properly when resized.

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.
Shorten & track links the smart way — ClickWhale for WordPress.