Minify an SVG Without Breaking It
This svg optimizer lets you optimize svg markup entirely in your browser, no upload required, whether you need to compress svg online for a live web project or just tidy up hand-written markup. Paste in an SVG exported from Illustrator, Figma, Inkscape, or Sketch and use it to minify svg content safely: strip out comments, metadata, and editor-specific cruft while leaving the actual shape data untouched. Acting as a straightforward svg file size reducer, it sticks to safe, lossless text-level cleanup rather than rewriting path geometry like a full svg minifier would, so the visual result is guaranteed to look identical to the original, just smaller.
How to Use This SVG Optimizer
Paste your SVG markup into the left panel, the optimized version appears instantly on the right. Toggle any of the six checkboxes above the panels on or off to control exactly what gets stripped, the byte count and percentage saved update live as you adjust them. Use Copy to grab the optimized markup, or the .svg button to download it as a file. The Before/After preview below the panels lets you visually confirm nothing changed.
What Each Optimization Option Removes
Each option targets a different source of SVG bloat, understanding what each one does helps you decide what's safe to strip for your use case. For example, checking "Remove metadata / title" will remove svg metadata such as authoring-tool identifiers and empty title/desc wrappers, while leaving your actual artwork untouched.
| Option | What It Removes |
|---|---|
| Remove comments | XML comments (<!-- ... -->), which have no effect on rendering |
| Remove metadata / title | <metadata>, <title>, and <desc> elements, drop title/desc only if you don't need the accessible name |
| Remove editor data | Inkscape, Sodipodi, Sketch, and Illustrator-specific namespaced attributes and elements, without touching real xlink:, rdf:, dc:, or cc: content still in use |
| Collapse whitespace | Extra spaces and line breaks between tags |
| Remove empty attrs | Attributes left behind with an empty value, like style="" |
| Shorten colors | Six-digit hex colors that can be written as three digits, and rgb() values converted to hex |
What This Tool Doesn't Do (and Why)
This is a text-level svg minifier, not a full geometry optimizer. It won't merge paths, simplify curves, reduce coordinate precision, or remove hidden and off-canvas elements the way a build-time tool like SVGO can. That's a deliberate tradeoff: every optimization here is a mechanical cleanup that can't change how the SVG looks, so you can safely apply it to production assets without a visual diff. If you need aggressive geometry-level compression on top of this, run the output through a dedicated SVGO pipeline afterward.