SVG Optimizer
Paste or upload an SVG to strip editor junk, minify, and shrink the file — entirely in your browser.
Drop an SVG file here or click to browse
.svg files only
Optimisation options
Removed
Visual output should be identical. If anything looks different, disable the relevant option.
Paste an SVG or upload a file to get started.
About this tool
Optimise SVG files in your browser. Removes editor metadata, comments, empty groups, default attributes, XML declarations, and DOCTYPE. Minifies whitespace, rounds decimals, and shortens IDs. Side-by-side preview with size savings. No upload, no server.
Frequently asked questions
What does the SVG Optimizer remove?
XML declarations, DOCTYPE, HTML comments, editor metadata (Inkscape, Illustrator, Sketch namespaces and attributes), empty groups, hidden elements, default attribute values (stroke="none", opacity="1", etc.), and unnecessary whitespace.
Will optimisation change how my SVG looks?
No — the optimisations are purely structural. The Preview tab shows both the original and optimised render side by side so you can confirm they are identical. If any option causes a visual change, disable it individually.
What is the difference between minify whitespace and other options?
Minify whitespace collapses the SVG to a single line for the smallest possible file size. The other options remove actual XML nodes and attributes. You can disable whitespace minification if you need the output to remain readable.
Is it safe to remove width and height attributes?
Yes, when the SVG has a viewBox attribute. Removing width and height makes the SVG responsive — it will scale to fill its container. If you need the SVG to render at a fixed size by default, leave this option disabled.
Does this tool send my SVG to a server?
No. All processing runs entirely in your browser using JavaScript string manipulation. Your SVG never leaves your device.
What is the Clean IDs option?
It shortens element IDs to minimal values like i0, i1, i2. This reduces file size when an SVG has many verbose IDs from an editor. Use with caution if other files reference these IDs externally.