IDs, defs, and references
Illustrator and Sketch exports often include long random IDs, duplicate definitions, and unused symbols. Cleaning these up is essential for icon sets and any SVG that uses masks, clips, or gradients referenced by id.
SVGO plugins in this topic
- Remove unused defs
removeUselessDefsRemoves unreferenced items in <defs> (gradients, symbols, paths) after other cleanup passes.
- Round/rewrite number lists
cleanupListOfValuesRounds numbers inside space-separated lists (points, viewBox, transforms) for smaller attributes.
- Replace duplicate elements with links
reusePathsReplaces duplicate path definitions with <use> references to a single definition.
- Sort children of <defs>
sortDefsChildrenSorts children inside <defs> for stable output and improved compressibility.
Related topics
Try it
Open SVGOMG.net, load your SVG, and toggle the plugins above in the Features panel.