SVG Optimizer
Paste SVG markup and remove the bloat that illustration tools leave behind — comments, XML declarations, editor namespaces (Inkscape, Sodipodi, XLink), <metadata> blocks, default attributes and redundant whitespace. See before/after size and copy the clean SVG.
How to use
- 1
Paste your SVG
Drop raw SVG markup into the left-hand editor. The textarea handles multi-line input and preserves whitespace — exactly what export tools produce.
- 2
Choose optimisations
Toggle which cleanups to apply: comments, XML declaration, editor namespaces (Inkscape/Sodipodi/XLink), <metadata> blocks, default attributes and whitespace.
- 3
Optimise
Click Optimise SVG. The cleaned-up markup appears on the right, with before/after size and a rendered preview.
- 4
Copy or download
Use Copy to put the SVG on your clipboard, or Save to download it as optimised.svg.
Common use cases
- Shrink icon SVGs exported from Illustrator or Inkscape before committing them.
- Strip editor cruft (sodipodi:namedview, inkscape:label) from a designer's hand-off.
- Minify SVG sprites to reduce the size of an inline icon system.
- Preview an optimised SVG to make sure no geometry was accidentally removed.
Limitations
- This is a regex-based optimiser. It does not parse the SVG tree, so it cannot deduplicate gradients, collapse groups or rewrite paths the way SVGO can.
- Inputs larger than 1 MB are rejected to keep the tab responsive.
- Inline
<script>tags are not stripped — do not paste untrusted SVG into shared documents. - The rendered preview uses
dangerouslySetInnerHTML; modern browsers do not execute inline scripts injected this way, but CSP rules on your site may differ.