SVG Optimizer
Optimize SVG online and cut its file size. Strip editor metadata, drop unreferenced ids, collapse redundant groups and round coordinates — every pass switchable, so you can see which one moved the number.
How it works
The file is parsed in your browser and each enabled pass walks the document: comments and <metadata> blocks are dropped, editor-namespace attributes (Inkscape's sodipodi:, Sketch's sketch: and the rest) are stripped, groups carrying no attributes are unwrapped into their parent, and ids that nothing in the file references are removed. The precision slider rounds every coordinate to the chosen number of decimals. The before/after counts update as you toggle, so a saving is always attributable to the pass that produced it.
Geometry is deliberately untouched. There is no path merging and no shape-to-path conversion — those are the passes where optimizers start changing how a file renders, so they are absent by design.
When to use it
Straight after exporting from Illustrator, Inkscape or Figma, before the file goes into a repository or onto a page — export cruft is routinely half the bytes of a small icon, and the removed-counts line tells you exactly what the editor left behind. Before converting to a React component or a data URI, since both carry the file's weight forward into your bundle or stylesheet. And whenever an icon that should be a kilobyte is somehow forty — the file-size guide explains where those bytes hide.
Common problems
- The file renders at a different size when opened directly. Removing width and height changes the standalone default box; the drawing still scales normally via its viewBox. Keep that pass off for files that get opened as documents rather than embedded.
- A gradient or clip path lost its target. Ids are only removed when nothing in the file references them — but a stylesheet or script outside the file can reference an id the optimizer cannot see. Disable the id pass for files that external code reaches into.
- Curves look subtly off after optimizing. Precision 0 on a small drawing grid visibly moves points. Two decimals is invisible at any realistic display size; go lower only on large coordinate systems.
- Diffs became useless. Minified output is one long line. Keep minify off for files you version, and let the server's gzip do that work instead.
Notes
- Nothing here changes geometry. Path merging and shape conversion are where naive optimizers start altering how a file renders, so they are deliberately absent.
<title>is kept — it is an accessibility feature, not metadata.- Ids are only removed when nothing in the document references them, so gradients and clip paths survive.