T-77 · Developer tools
Shrink SVG files: strip editor metadata, comments and default values, round path data and collapse whitespace, with a before and after preview.
Or paste markup below. The SVG is processed in your browser and never uploaded.
About this instrument
Paste SVG markup or open an .svg file to remove what browsers do not need: the XML prolog and doctype, comments, <metadata>, Inkscape, Sodipodi, Sketch and Illustrator attributes and namespaces, empty groups and attributes, and default values such as fill-opacity="1". Path data is rewritten with rounded numbers and minimal separators, numeric attributes are rounded to the decimals you choose, and whitespace is collapsed. Text, <style> and <script> contents are left intact. You see the size before and after and a side-by-side preview, all computed in your browser.
FAQ
It should. The previews show both versions so you can check. If something differs, raise the number of decimals or turn off the option that caused it and compare again.
Without width and height the SVG scales to its container, which suits responsive layouts and icons sized with CSS. The viewBox keeps the aspect ratio. Leave the option off if the SVG must keep a fixed size.
No. It is parsed and rewritten in your browser.
Related instruments