How to use it
- Choose one or more SVG files, or drop them on the box.
- Keep “Round numbers” off for an identical picture; round to 2 or 3 decimals for smaller files.
- See for each file what was removed and how many bytes were saved; the thumbnails show the picture before and after.
- Download each file, or all of them as one ZIP.
Rules and limits
What is removed
- Comments, the XML declaration and the DOCTYPE (entities defined there are written out), and the editor data of Inkscape, Sodipodi, Adobe Illustrator, Sketch, Affinity (Serif) and Figma: their elements, attributes and namespace declarations.
- <metadata> blocks, namespace declarations nothing uses any more, empty groups and empty <defs>, and ids that nothing refers to. An id stays when a url(#…), an href, an animation’s begin or end, an aria- attribute or a <style> rule names it; with a script in the file every id stays.
- Spaces and line breaks between tags, but not inside text, <title>, <desc>, <style> or <script>, nor where xml:space="preserve" is set.
- Optional: numbers in coordinates, paths and transforms rounded to 3, 2 or 1 decimals. The viewBox is never rounded.
Safety
- Nothing in the SVG is run: the file is read as text by our XML parser, and the thumbnails are pictures, which browsers draw without scripts and without loading outside files.
- Scripts and event handlers are reported and kept unless you tick the option to remove them; references to outside files are reported.
- Checked: a set of icons made in the test, also files saved by Inkscape 1.4, is drawn by Chrome before and after cleaning at 64 and 300 pixels: 0 pixels differ without rounding.
Limits
- Tested in Chrome: 10 files at once (5 of them saved by Inkscape 1.4.3) cleaned and drawn again with 0 different pixels; the time for large files was not measured.
- The page cleans files of up to 20 MB, at most 200 at once; that much was not tested. Files that are not well-formed XML are not changed; the page names the line and column.
Questions and answers
Will my icon look different?
Not without rounding: only parts that do not draw are removed, and the test set is drawn by Chrome before and after at two sizes with no pixel different. Rounding can move edges by a fraction of a pixel.
Why are titles and descriptions kept?
Screen readers read the <title> and <desc> of an SVG aloud, so they belong to the picture. Editor data, layer names and metadata do not.
Why does it not shorten path data like other optimizers?
Rewriting paths and shapes can save more, but it changes the drawing in ways that are hard to check. This page only does changes whose result is proven the same; use rounding for more savings.
Are my files uploaded?
No. They are cleaned in your browser, and the page cannot send them anywhere.