SVG Minifier

Minify SVG markup

SVG files exported from design tools carry a surprising amount of dead weight: editor metadata, namespace declarations nothing uses, generous whitespace, comments and generated element ids. Stripping that out often halves the file with no visual change at all, which matters when the icon is inlined into your HTML or CSS.

How to use it

  1. Paste your SVG markup or upload the file.
  2. Run the minifier to strip comments, metadata, editor namespaces and redundant whitespace.
  3. Compare the before and after sizes.
  4. Copy the minified markup into your project.

Frequently asked questions

Will minifying change how the image looks?

It should not. The minifier removes markup that does not affect rendering. Always check the preview afterwards, particularly for files using filters, gradients or referenced elements, which depend on ids that must be preserved.

How much smaller will the file be?

Files straight out of a design tool commonly drop by 40 to 60 percent. Files that have already been optimised will barely move.

Can I undo it?

Use the SVG Beautifier to restore readable indentation and line breaks. The comments and metadata that were removed are gone permanently, so keep your source file.

What exactly gets removed?

Comments, editor-specific namespaces such as those Inkscape and Illustrator add, metadata and title blocks that are not being read, and redundant whitespace between elements. Attributes that affect rendering are left alone.