How to use the SVG Optimizer
- Paste SVG code into the left panel or upload a
.svgfile. - Select the optimization options you want to apply.
- Click Optimize: the cleaned SVG appears on the right with a size reduction report.
- Copy the result or download the optimized
.svgfile.
What each option removes
- Comments:
<!-- ... -->blocks left by design tools like Illustrator, Figma, or Sketch. They add nothing to the rendered output. - Metadata:
<metadata>tags and editor-specific XML namespaces (xmlns:inkscape,xmlns:sodipodi). These are only useful in the originating design tool. - Hidden elements: nodes with
display:noneorvisibility:hiddenthat do not contribute to the visible graphic. - Collapse whitespace: unnecessary spaces, tabs, and line breaks between tags. The resulting SVG is harder to read but significantly smaller.
- Minify inline styles: compacts style attribute values by removing redundant spaces and shortening color values.
Why optimize SVGs?
SVGs exported from design tools like Illustrator or Inkscape contain a lot of extra markup that is useful for editing but unnecessary for display. A typical icon SVG can be reduced by 30-70% by removing this metadata. Smaller SVGs mean faster page loads and less bandwidth, especially for sites with many inline icons.
For production use
This tool is a lightweight client-side optimizer. For a production build pipeline, consider SVGO (the industry-standard Node.js SVG optimizer) or integrate it via a bundler plugin (Vite, Webpack, PostCSS).
Privacy
All optimization runs in your browser. No SVG code is sent to any server.