Optimize SVG
Shrink SVG files with svgo: same rendering, fewer bytes. Drop as many as you like.
Runs on your device. The file is never uploaded.
Optimize SVG runs svgo with its default plugin preset over your file, repeating passes until the output stops shrinking, and returns it as -min.svg with the byte count either side. Turning multipass off leaves a single pass. A document whose root element is not svg is refused before svgo touches it, because svgo would gut it and report a saving.
Questions
Does it change how my SVG looks?
It is not supposed to. The engine is svgo with its default plugin preset, which removes comments, editor metadata, unused definitions and redundant attributes, and rewrites path data and numbers more compactly. The viewBox is kept, because the plugin that would remove it is not part of the default preset, so a responsive SVG stays responsive.
Will it break my CSS or JavaScript that targets ids?
It can, if the ids are referenced from outside the file. svgo removes unused ids and shortens the ones it can see being used, so an id that only your stylesheet or script knows about might be renamed or dropped. svgo skips that cleanup entirely when the SVG itself contains a style or script element. Check any icon you address by id from a sprite sheet.
What is multipass and should I leave it on?
Multipass repeats the optimization until the output stops getting smaller, and it is on by default. Turning it off means a single pass, which is faster and slightly more conservative. On a normal icon or illustration the difference is a few percent.
Why does it refuse my file with "not an SVG"?
Because the root element is not an svg element, or the file contains no XML element at all, and the error says which. svgo would still appear to succeed on such a file and hand back a destroyed document announced as a large saving, so the file is checked before svgo touches it. If you have an SVG fragment, wrap it in an svg element with the SVG namespace first; if the SVG is embedded in a bigger document, extract it into its own file.
What does "refusing to report a saving" mean?
It means optimizing emptied your file out. A document rooted at svg whose contents are not SVG passes the first check, and svgo then drops every child it does not recognise, leaving something that would draw nothing. The tool compares before and after, and if the result draws nothing while the input drew something, it refuses and leaves your file untouched.
What is the output called, and can I do a folder at once?
Each file comes back as its own result named with -min before the extension, so logo.svg becomes logo-min.svg, along with a line giving the byte count before and after and the percentage change. Drop as many files as you like; each is optimized separately, and everything runs in this browser tab.