SVG Minifier

Paste SVG markup to strip comments and the XML declaration and collapse whitespace, then see the byte savings and copy the smaller code.

About SVG Minifier

Paste SVG source into the input box and the minified version appears next to it as you type. The tool removes whitespace between tags, collapses repeated spaces, and, through two checkboxes, strips XML comments and the leading XML declaration. A badge shows the size before and after in bytes along with the percentage saved.

Copy the result with one click to inline it in HTML, a CSS data URI or a component file. Everything runs in your browser. The cleanup is text-based: it does not rewrite path data, round numbers, merge shapes or remove editor metadata elements, so expect modest savings on files that are already compact.

How to use it

  1. Paste your SVG markup into the Raw SVG Markup box.
  2. Keep or clear the comment and XML declaration checkboxes.
  3. Check the size reduction badge.
  4. Click Copy SVG to copy the minified code.

Questions

Does it simplify paths or round coordinates?

No. It only removes comments, the XML declaration and extra whitespace; the drawing data is left unchanged.

Can I upload an .svg file?

The tool takes pasted text. Open the file in a text editor and paste its contents.

Is my SVG sent anywhere?

No. The minification runs in your browser as you type.

More Image & Favicons tools

Home · All Tools · Blog