Free browser tool

SVG optimizer / minifier

Validate SVG syntax and reduce size by removing comments and unnecessary whitespace.

Input and settings

How to use it

Check that an SVG is readable, then remove optional comments/XML declaration and obvious extra whitespace. The cleanup is deliberately conservative and does not rewrite paths or redesign the SVG.

  1. Choose an SVG file or paste SVG markup.
  2. Choose whether to remove comments and the XML declaration.
  3. Run optimization, compare byte sizes, then copy or download optimized.svg.
Validation
Rejects malformed SVG/XML before cleanup
Optional removal
XML declaration and comments
Always cleaned
Inter-tag whitespace, repeated spaces and space before />
Not performed
Path simplification, attribute merging, ID shortening, semantic rewrites

This optimizer favors predictable cleanup over aggressive rewriting

An SVG with lots of comments and formatting whitespace can shrink noticeably, but path coordinates and element structure are not intelligently recomputed.

Whitespace can matter in some SVG text content. Always preview the optimized file when the source contains text or formatting-sensitive markup.

Broken SVG markup is rejected before optimization

If tags, quotes or other XML syntax are malformed, the tool stops instead of producing a smaller but still broken file.

Comment removal is optional

Keep the checkbox off when comments contain production notes, attribution or other information you need to preserve.

Advanced SVG semantics are left alone

The tool does not round path coordinates, collapse transforms, merge shapes or remove attributes based on rendering analysis.

The reduction percentage is a practical size estimate

The before/after figure shows how much smaller the cleaned SVG text becomes. It is useful for comparison, but final transfer size can differ after server compression such as gzip or Brotli.