SVG Optimizer
Compress SVG markup with SVGO, entirely in your browser. Paste or drop a .svg file.
Why optimize SVG?
Design tools (Figma, Illustrator, Sketch) export SVG with editor metadata, excessive coordinate precision, and redundant grouping that add nothing visually but bloat the file. SVGO removes it while keeping the rendered result identical.
What the optimizer changes
SVGO runs a real XML parser and a set of transform passes: it strips comments and <metadata>, merges and shortens paths, converts basic shapes to paths where smaller, rounds numeric precision, and drops unused namespace declarations and empty groups.
None of this is a lossy visual change; SVGO's default preset is designed to preserve rendering. Still, always check the before/after preview below, since an unusual SVG (heavy use of CSS classes, embedded fonts) is more likely to hit an edge case than a plain icon.
Optimizing is not sanitizing
SVG can carry a <script> element or onload/onclick event handlers, and SVGO's default preset does not touch either — they pass straight through an "optimized" file. The "Strip scripts & event handlers" toggle above (on by default) explicitly removes both, plus javascript: links.
This matters if you plan to inline the output directly into a page with v-html or dangerouslySetInnerHTML rather than use it as an <img> src: an inlined SVG executes any script it carries, an <img>-loaded one never does.