Attributes and namespaces
These transforms trim attribute noise without changing the visible graphic. They are safe defaults for most web SVGs. Turn off removeXMLNS or removeUnusedNS only when your asset uses unusual namespace setups.
SVGO plugins in this topic
- Clean up attribute whitespace
cleanupAttrsTrims whitespace in attribute values and normalizes quoting so attributes are minimal.
- Remove xmlns
removeXMLNSRemoves redundant default xmlns attributes when they can be inferred, shrinking attribute noise.
- Remove unused namespaces
removeUnusedNSRemoves xmlns declarations that are not referenced anywhere in the document.
- Remove unknowns & defaults
removeUnknownsAndDefaultsDrops attributes and elements that match SVG defaults or are unknown to the spec.
- Remove unneeded group attrs
removeNonInheritableGroupAttrsRemoves presentation attributes on groups that children cannot inherit meaningfully.
- Remove empty attrs
removeEmptyAttrsDeletes attributes with empty values (fill="", style="", etc.).
- Sort attrs
sortAttrsSorts attributes alphabetically for better gzip compression and consistent diffs.
- Remove/tidy enable-background
cleanupEnableBackgroundRemoves or normalizes legacy enable-background attributes from old Illustrator exports.
- Minify colours
convertColorsConverts colors to shorter forms (#RGB, named colors) and merges equivalent values.
Related topics
Try it
Open SVGOMG.net, load your SVG, and toggle the plugins above in the Features panel.