Paste raw <svg> markup or open a local .svg file, set the Coordinate Precision slider (0–5 decimals), enter a React Component Name, and toggle options such as Use currentColor or TypeScript (.tsx). Switch output tabs between Minified SVG, React JSX/TSX, and Data URI.
2. Path Coordinate Rounding & Self-Closing Tags
Path commands (d="M13.000042 2.00018...") account for the majority of SVG payload weight. Rounding coordinates to 2 decimal places and collapsing empty paired tags (<path></path> → <path/>) cuts byte size dramatically without altering visual fidelity at standard icon sizes.
3. Production-Ready React & TypeScript Output
The JSX generator maps hyphenated SVG attributes to React camelCase equivalents, forwards {...props} onto the root <svg> element so consumers can override width, height, className, or aria-hidden, and imports type { SVGProps } from 'react'.
Removing viewBox="0 0 24 24" prevents an SVG from scaling proportionally when its width and height CSS properties change. Our optimizer always preserves viewBox and reports its dimensions in the summary badge.
Zero-Decimal Rounding on Micro ViewBoxes
If an icon uses a tiny coordinate space like viewBox="0 0 16 16", rounding coordinates to 0 decimals (whole integers) can distort curves. Keep precision at 1 or 2 decimals for small viewBoxes.
Preserving fill="none" with currentColor
Stroke-based icon libraries (such as Lucide and Feather) set fill="none" on the root <svg>. Our Use currentColor option preserves none and url(#gradient) references so hollow icons never turn into solid blobs.
Accessible SVG Icons in Buttons
When an SVG icon sits inside a button that already has visible text, add aria-hidden="true" to the SVG; when an icon-only button has no text, add an aria-label to the button itself.
Frequently Asked Questions
What gets removed during client-side SVG optimization?
Vector editors like Figma, Adobe Illustrator, and Inkscape embed XML declarations (<?xml...?>), DOCTYPE headers, HTML comments, <metadata>/<title>/<desc> blocks, proprietary xmlns:inkscape/sodipodi namespaces, and verbose 6-decimal path coordinates. Stripping metadata and rounding coordinates to 2 decimal places typically shrinks SVGs by 30%–65%.
How does the React JSX/TSX converter transform SVG attributes?
React JSX requires camelCase DOM property names for hyphenated and namespaced SVG attributes—converting stroke-width to strokeWidth, stroke-linecap to strokeLinecap, fill-rule to fillRule, and class to className—while injecting {...props} and typing the component with SVGProps<SVGSVGElement>.
Why should I enable "Use currentColor" for icon components?
Replacing hardcoded hex fills and strokes (such as stroke="#2563eb") with currentColor allows your SVG icon to inherit the CSS color property of its parent button or link automatically across light, dark, and hover states.
Why is a UTF-8 URL-encoded SVG Data URI smaller than a Base64 SVG Data URI?
Base64 inflates ASCII SVG text by 33%, whereas a minimally percent-encoded data:image/svg+xml;utf8,... URI keeps readable SVG tags intact and compresses significantly better under Gzip and Brotli.
Are my uploaded .svg files or brand icons sent to any server?
No. All SVG parsing, minification, coordinate rounding, and JSX code generation run 100% locally inside your browser.