SVG Optimizer

Strip comments, defaults and excess whitespace from SVG markup.

Paste any SVG and the optimizer removes comments, XML declarations, doctypes, redundant whitespace, and default-valued attributes (like fill-opacity="1"). Numeric values are rounded to two decimals for smaller files. Live size comparison shows you the savings.

Common use cases

  • Trim icon files exported from Figma or Illustrator before shipping
  • Reduce critical CSS / inline SVG payload for above-the-fold pages
  • Clean up icons before pasting them into React components
  • Slim down hero illustrations on landing pages for better Lighthouse scores

Frequently asked questions

Does it preserve animations and CSS?
Yes — `<style>`, `<animate>`, `<animateTransform>` and other dynamic elements are kept. Only redundant attributes and whitespace are removed.
Is this as aggressive as SVGO?
It's a focused subset that handles the most impactful wins (whitespace, defaults, number rounding) without breaking complex SVGs. For maximum compression, use SVGO with a custom config.
Will rounding break my icon?
Two-decimal precision is well within the tolerance of any practical SVG icon. If you need pixel-perfect path data, skip the rounding.

Related tools