SVG Optimizer & Minifier
Paste SVG code to remove editor cruft, comments, empty groups, and whitespace. See size savings instantly and download the optimized file.
SVG Input
Optimization Options
Original
630 B
Optimized
175 B
Savings
72%
Optimized SVG
Live Preview
Frequently Asked Questions
What does the SVG optimizer remove?
By default it removes: the XML declaration, HTML comments, <metadata> blocks, Inkscape/Sodipodi/Sketch namespace declarations and elements, editor-specific attributes, empty <g></g> elements, single-child groups with no attributes, and unnecessary whitespace between tags. Each option can be toggled independently.
Is it safe to remove id attributes?
The 'Remove id attributes' option is off by default because it requires caution. The tool scans for all ids referenced via url(#id), href='#id', or xlink:href='#id' and preserves those. Unreferenced ids are safe to remove, but always verify the preview looks correct after enabling this option.
Does this work without uploading my file to a server?
Yes. All optimization runs entirely in your browser using JavaScript string manipulation. Your SVG code never leaves your device.
How do I download the optimized SVG?
Click the 'Download .svg' button. The tool creates a Blob URL in your browser and triggers a file download named 'optimized.svg'. No server involvement.
What is the checkerboard background in the preview?
The checkerboard pattern is a standard way to indicate transparent areas in graphics. It lets you see at a glance whether your SVG has transparent regions and how they would look against different backgrounds.