Skip to main content
Image / SVG Developer Tools

SVG Minifier

Remove unnecessary whitespace and comments from SVG markup to reduce its size, without altering its structure.

Paste your SVG markup below - this tool strips unnecessary whitespace and comments to produce a smaller file.

For deeper size reduction (redundant attributes, precision trimming), see the SVG Optimizer - or use the SVG Formatter to reverse this and get readable markup back.

What Does This Tool Remove?

Whitespace between tags that doesn't affect rendering, and XML/SVG comments - both are purely for human readability and have no effect on how the SVG actually displays.

Why Use This Tool?

A hand-written or design-tool-exported SVG often carries extra whitespace and comments that add unnecessary bytes without any visual benefit - stripping them is a safe, quick size reduction.

How to Use It

  1. Paste your SVG markup.
  2. Click Minify.
  3. Copy the smaller result and compare the before/after size.

Limitations

This tool only removes whitespace and comments - it does not touch attribute values, path data, or structure, so it's inherently conservative. For more aggressive size reduction, use the SVG Optimizer, and note that more aggressive optimization can occasionally alter edge-case rendering behavior in unusual SVGs.

Share this tool: