Free Micro-Tool · 100% In-Browser · No Sign-Up

SVG Cleaner & React JSX / Data URI Converter

Paste SVG markup or drop a .svg file. This tool strips comments, <metadata>, XML declarations, editor namespaces (Illustrator/Inkscape), and inline <script>/event-handler attributes, then exports a cleaned SVG, a React JSX component (class→className, stroke-width→strokeWidth, etc.), or a CSS data URI.

Paste or Drop SVG

Drag an .svg file here, or
No SVG loaded yet.

Live Preview

Preview appears here
Copied!
Paste SVG on the left to see output here.

This cleaner is a free tool from SpecPeek — the local-first CSS, Tailwind & SVG inspector for Chrome and Edge. SpecPeek Pro can batch-export every SVG and image on a live page as a ZIP, directly from the page you're inspecting.

Add to Chrome — Free
FAQ

What gets cleaned, and what's safe

What exactly does "clean" remove?

XML declarations, comments, <metadata>/<title>/<desc>, Illustrator/Inkscape/Sodipodi editor namespaces, redundant whitespace, and — for safety — any <script> tag, inline on* event handler, or javascript: link.

Is it safe to paste an SVG from an untrusted source?

Scripts and event handlers are stripped before the preview ever renders the markup, so a malicious payload in a pasted SVG can't execute in your browser. This tool never sends the file anywhere either.

Why did my style="..." attribute become an object in JSX?

React requires inline styles as a JS object, not a CSS string. The converter parses style="color:red" into style={{ color: 'red' }} automatically.

URL-encoded vs. Base64 data URI — which should I use?

URL-encoded is usually shorter and more readable in CSS for simple icons. Base64 is safer for SVGs with lots of special characters or quotes. Both work in every modern browser.