What an SVG minifier removes
SVG files exported from Figma, Illustrator, Sketch or Inkscape carry a lot of text the browser never needs: XML prologs, comments, editor namespaces, layer names and indentation. Minifying strips that out so icons and illustrations download faster and inline cleanly into HTML or React components.
- Comments and prologs —
<!-- … -->,<?xml … ?>and DOCTYPE declarations. - Editor metadata — attributes such as
sketch:type,serif:id,xml:spaceandenable-background. - Whitespace — line breaks and indentation between tags.
When to keep ids
Gradients, clip paths, masks and <use> elements find each other by id. Removing ids from those files breaks them, so ids are kept by default. Switch it off for simple icons made only of paths, where ids are just leftover layer names.
Frequently asked questions
Will minifying change how my SVG looks?
It should not: the tool removes comments, editor metadata and whitespace, which have no visual effect. Always check the preview — an SVG that relies on id references (gradients, masks, <use>) needs those ids, so leave “Keep ids” switched on for those files.
How much smaller will my SVG get?
Exports from design tools often shrink by 20–60%, because they carry editor metadata, comments and indentation. Hand-written or already-optimised SVGs shrink much less.
Is this the same as SVGO?
No. SVGO also rewrites path data and merges shapes, which saves more but can occasionally change rendering. This tool does the safe clean-up that never alters the drawing; use SVGO in your build when you need the last few percent.
Built and maintained by Pradeep Bhandari, Senior Engineering Manager & Full-Stack Architect. Last reviewed .