What gets removed
SVG files exported from design tools often carry comments, XML/DOCTYPE declarations, editor-specific metadata (Inkscape and Sketch namespaces are common culprits), and extra whitespace that add bytes without changing how the image renders. This strips all of that and collapses whitespace between tags, while leaving the actual path and shape data untouched.
Why this is a cleanup pass rather than a full optimizer
This is a straightforward cleanup pass, not a full optimizer - it does not simplify path data, merge shapes, or shorten attribute values the way a dedicated tool like SVGO does. For most hand-exported icons and illustrations, this alone meaningfully reduces file size, but a complex illustration with heavy path data will need a dedicated path-optimizing tool to shrink further.
Why editor-specific namespaces and attributes are safe to remove entirely
Attributes under an inkscape: or sodipodi: namespace exist purely so that specific
design application can reopen the file with its original layers, guides, and editing history intact - a browser
or any other program simply displaying the SVG ignores them completely, which is exactly why removing them
changes the file size but never the rendered result.
Why this never touches the actual path and shape data
The one thing this tool deliberately leaves alone is the content that actually defines what the image looks like - path coordinates, shape elements, and style attributes - which is why running this pass is safe to do on any SVG without risk of subtly altering its appearance, unlike a more aggressive optimizer that simplifies path data and can occasionally introduce tiny visual differences.