SVGOMG.net How to optimize

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 cleanupAttrs

    Trims whitespace in attribute values and normalizes quoting so attributes are minimal.

  • Remove xmlns removeXMLNS

    Removes redundant default xmlns attributes when they can be inferred, shrinking attribute noise.

  • Remove unused namespaces removeUnusedNS

    Removes xmlns declarations that are not referenced anywhere in the document.

  • Remove unknowns & defaults removeUnknownsAndDefaults

    Drops attributes and elements that match SVG defaults or are unknown to the spec.

  • Remove unneeded group attrs removeNonInheritableGroupAttrs

    Removes presentation attributes on groups that children cannot inherit meaningfully.

  • Remove empty attrs removeEmptyAttrs

    Deletes attributes with empty values (fill="", style="", etc.).

  • Sort attrs sortAttrs

    Sorts attributes alphabetically for better gzip compression and consistent diffs.

  • Remove/tidy enable-background cleanupEnableBackground

    Removes or normalizes legacy enable-background attributes from old Illustrator exports.

  • Minify colours convertColors

    Converts 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.