Toolstia / SVG minifier
SVG minifier
Paste SVG code to make it smaller. The tool removes comments, editor metadata and extra whitespace, rounds long numbers in paths and shows the size saved, with a preview of the result next to the original.
The tool removes comments, the XML header, doctype, editor metadata and extra spaces, and rounds the numbers in path and polygon data. It keeps all ids and styles so references keep working. Check the preview before you use the result.
How it works
- Paste the SVG code.
- Choose how many decimals to keep in path data.
- Compare the previews, then copy the minified code.
What is removed
XML headers, doctypes, comments, editor data from tools such as Inkscape and Illustrator, empty attributes and whitespace between tags.
Rounding
Paths often hold numbers with many decimals. Three decimals is almost always invisible, and fewer can shrink small icons further.
Safe by design
Ids, classes and styles are kept so that gradients, masks and CSS rules still work. Look at the preview before you ship the result.
Titles
Title and desc elements help screen readers. Remove them only for purely decorative graphics.
Questions
Is my SVG uploaded?
Everything happens in your browser, and nothing you enter is sent anywhere.
Will the image look different?
With three or more decimals you should see no difference. Lower the decimals step by step and watch the preview.
Does it handle large files?
It works on any SVG your browser can hold, but very large files may take a moment.