Paste SVG markup or drop an .svg file to get a smaller version with the same rendering. The optimizer removes comments, <metadata>, the XML declaration and DOCTYPE, and the editor-only namespaces and attributes that Inkscape, Sodipodi, Sketch and Illustrator leave behind. It also drops empty attributes, empty groups, default values such as x="0" or opacity="1", IDs that nothing references, and rewrites path data in its shortest form. Number precision is adjustable; three decimals is plenty for icons drawn on a 24 or 96 unit grid.

The before/after panel shows the byte sizes, the percentage saved, and both versions rendered as images. The preview loads each SVG through an <img> element, so any script inside the file never runs on the page. Everything happens locally in your browser.

A few things are kept on purpose:

  • IDs referenced through url(#id), href/xlink:href or aria-labelledby, and every ID when the file has a <style> block, scripts or animations.
  • Inherited properties like fill="#000" or stroke-width="1". Removing them is safe in an <img>, but it changes the result once the SVG is inlined into a page whose CSS sets fill on a parent.
  • Transforms, text content and whitespace inside <text> elements.

“Remove width/height” keeps the viewBox (and creates one from the width and height if it is missing), so the icon scales to whatever box you put it in.