Shrink SVG files exported from design tools

Editor-exported SVGs carry comments and metadata that inflate the file. Strip them before shipping icons on the web.

Tools used in this guide

The job

An icon exported from Inkscape or Figma often includes a <metadata> block, editor namespace attributes, XML comments, and generous whitespace. None of it affects rendering, but it bloats every page load where the SVG is inlined or cached.

Worked example

A typical editor export drops 15–40% of its bytes after minification: comments and <metadata> are removed, sodipodi:/inkscape: attributes vanish, and whitespace between tags collapses. The tool reports before/after sizes so you can see exactly what was saved.

  • Removed: comments, <metadata> elements, editor namespace attributes (sodipodi, inkscape, sketch, figma), the XML declaration, and inter-tag whitespace.
  • Kept: every path, shape, gradient, id, class, and style attribute — the pixels do not change.

Before you replace the file

Open the output once in a browser or preview it in place. A handful of pathological files — comments inside CDATA, scripts inside the SVG — can survive minification but behave differently; check the rendered result, not just the byte count.