SVG Optimizer
Strip comments, metadata and redundant whitespace from SVG markup, and report the real byte saving.
SVG Optimizer
Minify and clean up SVG code.
Strips comments, the XML declaration and the DOCTYPE, collapses whitespace outside text content, and shortens six-digit hex colours. It does not rewrite or simplify path data.
Drop an .svg file here, or
What SVG Optimizer does
SVG files exported from design software carry a great deal that a browser does not need: editor metadata, comments, XML declarations and generous indentation. Removing that shrinks the file with no visual change at all.
This is a text cleanup, not a geometric one. It never touches path data, so the drawing itself cannot be altered by running it.
- Remove comments, XML declarations and doctypes
- Collapse redundant whitespace outside text content
- Shorten six-digit hex colours to three where they are equivalent
- Upload a file or paste markup, and download the result
How to use SVG Optimizer
- 1
Provide your SVG
Upload the file or paste the markup.
- 2
Optimise
The cleaned markup appears alongside the byte saving.
- 3
Check it still renders
Preview the result before replacing your original.
Limits and known behaviour
- It does not simplify or re-encode path data, which is where a dedicated optimiser such as SVGO finds most of its savings. Expect a smaller reduction than SVGO would achieve.
- It does not remove unused definitions, collapse groups, or merge duplicate elements.
- Text content, including inside text, tspan, style and script elements, is deliberately left untouched so that nothing visible is corrupted.
- The markup is not validated; invalid SVG in gives invalid SVG out.
Privacy and data handling
Runs entirely in your browser
- Your image is decoded and redrawn by the browser inside this page. It is never uploaded.
- SVG is text, and it is processed here as text. Nothing is uploaded.
- Nothing is stored; the file and the result disappear when you close the tab.
Site-wide data handling, including analytics and advertising, is described in the privacy policy.
Frequently asked questions
Why is my saving smaller than SVGO's?
Because most of SVGO's saving comes from rewriting path data — reducing coordinate precision and merging commands. That is powerful and can subtly change the drawing, so this tool deliberately does not do it.
Can this break my icon?
It should not. Only comments, declarations and whitespace outside text content are touched, and text and style contents are protected. Always preview the result regardless.