About SVG Optimizer
SVG Optimizer minifies and cleans SVG markup with SVGO, the de-facto SVG optimiser used by every major build tool. The pipeline removes editor metadata (Inkscape, Illustrator, Sketch comments and namespaces), collapses default attributes, rounds path coordinates, drops unused IDs, and merges duplicate gradients — typically shaving 30–60% off the file size without any visual difference. Before-and-after sizes are reported next to the output so you can see what each pass saved.
Reach for it whenever you are shipping SVG to production: an icon set in a build, a hero illustration, a brand mark, or any vector graphic destined for the network. Smaller SVGs are faster to download and parse, especially when they are inlined into HTML for first-paint icons. The XML formatter pretty-prints SVG (it is XML) but does not optimise it; this tool runs the SVGO plugins. For raster image conversions, use Image to Base64; for favicons specifically, use Favicon Generator.
Examples
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><!-- Created with Inkscape -->
<path d="M12.000,2.000 L22.000,22.000 L2.000,22.000 Z" fill="#FF0000" stroke="none" />
</svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="red" d="M12 2l10 20H2z"/></svg>Comment dropped, default `stroke="none"` removed, coordinates rounded, path data shortened, named colour preferred. ~50% size reduction with no visual change.
Frequently asked questions
Will any of the optimisations change how my SVG renders?
Not with the default plugin set. The default config removes only data that does not affect rendering — comments, editor metadata, redundant attributes. Aggressive plugins (`removeViewBox`, `cleanupIDs` with renames) are off by default because they can break references; opt in only if you know your SVG does not use them.
How is this different from XML Formatter?
XML Formatter pretty-prints or minifies XML markup — useful for reading. SVG Optimizer runs SVGO plugins that semantically understand SVG: it removes unneeded attributes, simplifies path data, and folds defaults. Use XML Formatter to read; use SVG Optimizer to ship.
Will it break SVG references like clipPath or use elements?
The default plugins preserve IDs that are referenced by other elements. If you opt into aggressive ID cleanup, the tool first scans the whole document for references and skips IDs that are still in use; the *prefix* option helps avoid collisions when multiple SVGs are inlined into the same page.
What about animations and embedded scripts?
Animation elements (`<animate>`, `<animateTransform>`) and `<style>` blocks are preserved. Inline event handlers and `<script>` tags can be stripped on request — useful for building a sanitised SVG library, dangerous if your SVG actually relies on them.
