The Vector Scrubber
Figma exports are messy. Don't ship bloated code.
An SVG optimizer strips the cruft a design tool bakes into exported vector code: comments, editor metadata, hidden IDs, redundant namespaces, and slack whitespace. Figma and Illustrator write SVGs for their own round-trip editing, not for the web, so a single icon can ship with a Generator comment, a metadata block, per-layer IDs, and 6-decimal coordinates. Paste it here and the scrubber can cut that weight by 30% or more, leaving markup you can drop straight into a component.
What gets stripped
The scrubber runs these passes, in order:
-
XML prolog, doctype, and
<!-- comments --> -
<metadata>,<title>, and<desc>blocks -
Editor namespaces (
inkscape:,sodipodi:) and throwaway attributes likeidanddata-name - Whitespace between tags, with decimals rounded to 2 places
-
A
viewBoxandfill="currentColor"added when the root has none
Byte reduction on real exports
| Source | Before | After | Saved |
|---|---|---|---|
| Figma icon | 195 B | 155 B | 21% |
| Illustrator export | 357 B | 175 B | 51% |
| Inkscape file | 339 B | 98 B | 71% |
How it works
Paste your dirty SVG from Figma or Illustrator.
The tool sanitizes the markup right in your browser.
It removes: editor namespaces, weird IDs, comments, and metadata.
It adds: viewBox and fill="currentColor" for flexibility.
Export to Clean SVG, React/JSX, or CSS Data URI.
Why it matters
Design tools generate XML junk - metadata, weird IDs, and comments. This bloats your DOM and hurts performance. This tool scrubs the markup in your browser, stripping the cruft while preserving the geometry. It also formats it for React or CSS instantly, saving you the 'attribute renaming' dance.
Sanitization Steps
1. Remove attributes: id, data-name, enable-background
2. Strip editor namespaces (inkscape:, sodipodi:)
3. Remove XML comments
4. Round decimal precision (10.2342352 → 10.23)
5. Add viewBox and fill="currentColor"