SVG Optimizer Online

Compress and optimize SVG files by removing comments, metadata, and redundant data.

Float Precision:
INPUT
OUTPUT

When to use SVG Optimizer

Apply lightweight text cleanup to an SVG snippet.

How to use SVG Optimizer

Paste SVG, set decimal precision and removal options, then click Optimize. Compare the result with the original before using it.

Worked example

Example — verified tool behavior
<svg><!-- hi --><rect width="1.23456"/></svg> at precision 3 → <svg><rect width="1.235"/></svg>

How the tool handles input

The tool can remove comments, metadata, title and description elements, and optionally double-quoted viewBox attributes. It rounds decimal-looking text and collapses whitespace with regular expressions. Displayed sizes use Blob byte counts.

Limitations

This implementation is regex-based, not a full SVG optimizer or sanitizer. Rounding can alter text, IDs or other decimal-looking content. Removing titles/descriptions can remove accessible names, and removing viewBox can change scaling. Retain the original and inspect rendering.

Frequently asked questions

Does the tool validate the full XML document?

No. The initial check only looks for an svg marker.

What are the main limitations?

This implementation is regex-based, not a full SVG optimizer or sanitizer. Rounding can alter text, IDs or other decimal-looking content. Removing titles/descriptions can remove accessible names, and removing viewBox can change scaling. Retain the original and inspect rendering.