Paste SVG code to strip comments, editor data and extra digits. See the bytes saved. The SVG is never drawn or run, and it stays in your browser.
To minify an SVG, paste its code and copy the shorter version from the result box: the tool removes what a browser does not draw, such as comments, editor data, indentation and empty groups, and shortens the numbers and colours that remain. It reads the file with its own small XML reader, changes the elements and attributes you have switched on, and writes the text back out. Each operation is a toggle. Comments, the XML declaration and DOCTYPE, metadata and editor data, whitespace, empty attributes and groups, number rounding and colour shortening start on. Unused IDs, data-name attributes, title and desc elements, and scripts are left alone until you turn them on. The viewBox is never changed. The page opens with an Inkscape-style icon so you can see a result before you paste anything.
The sample is a 24 by 24 icon with an XML declaration, an Inkscape comment, a sodipodi:namedview element, a metadata element, a layer group, one path and an empty group. It is 785 bytes. With the default options it comes out at 224 bytes, 71.5 percent smaller. The declaration, comment, namedview, metadata, Inkscape attributes and namespaces, version attribute and empty group are gone. The size 24.000000 becomes 24, the path M 12.000000,2.500000 L 21.500000,12.000000 becomes M12 2.5L21.5 12, and #ffffff and #000000 become #fff and #000. The stroke-width inside the style attribute stays 1.500000, because numbers inside style code are not rounded. Bytes are counted in UTF-8, the size the saved file has.
Path data is read command by command, so packed forms such as 1.5.5 (two numbers, 1.5 and .5), exponents such as 1e-5 and the arc flags in a00.5.5 are understood. Each number is rounded to the decimal places you choose, trailing zeros and leading zeros are dropped, and a space is written only where two numbers would otherwise run together. Commands are kept as written: the tool does not turn absolute coordinates into relative ones, merge paths or simplify curves, so its savings are smaller than a tool that does. If a path cannot be read, it is copied unchanged. Rounding relative commands such as l and c adds up small errors along a long path, so check an icon with many relative segments at 2 or fewer decimal places. Rounding also applies to points, transforms, and size and position attributes such as x, width and cx. It never changes opacity, offset or the viewBox.
An ID is kept when url(#id), an href, a style rule, an animation start or an aria attribute points at it, and every ID is kept if the file has a script. Unused IDs are only removed when you switch that option on; leave it off if page CSS or JavaScript picks elements by ID on an inline SVG. A comment that starts with <!--! is kept because it usually holds a licence. A DOCTYPE is kept when the file still uses an entity it defines. The page does not draw your SVG. It shows no preview, because an SVG can contain script and drawing it in the page could run that script. Open the saved file in a browser tab or an image viewer to check how it looks.
The input must be well-formed XML with an svg element at the top, up to 5 MB and 500 levels deep. A tag, quote or comment that is not closed stops the run with a message and shows no output. Text inside style elements keeps its meaning: whitespace is shortened and hex colours are shortened only inside rule blocks, so a selector such as #aabbcc stays as it is. Download .svg saves the result as an SVG file. Everything runs in this tab.
Open the .svg file in a text editor, paste its code into the box and copy the result. The default options remove the comment, metadata and indentation and round numbers to 3 decimal places. The sample drops from 785 to 224 bytes, 71.5 percent.
Only through rounding. Removing comments, metadata, empty groups and whitespace does not change the drawing, and the viewBox is never touched. Rounding to 3 decimal places moves a point by at most 0.0005 units; at 0 decimals it can move by 0.5 units, which shows on a small icon.
Leave Remove metadata and editor data on. It removes metadata elements, sodipodi:namedview, and attributes and namespaces with the inkscape, sodipodi, sketch and serif prefixes, as well as Adobe Illustrator namespaces. data-name layer names have their own switch.
An SVG can contain script, and showing it on this page could run that script. The tool only changes the text and never draws it, so you cannot see the picture here. Save the result as a .svg file and open it in a browser to check it.
5 MB, counted in UTF-8 bytes. Over that, the tool shows a message and does nothing. The file also needs to be well-formed XML: a missing closing tag or an unclosed quote gives an error instead of output.
No. The text is processed in your browser and not uploaded. Your SVG is never saved; only your option settings are kept on this device.