Minify SVG files by stripping comments, collapsing whitespace, and removing spaces between tags. Shows compression ratio and byte savings instantly. Browser-based.
The SVG Minifier reduces SVG file size through multi-pass whitespace optimisation: it strips all XML/HTML comments (`<!-- ... -->`), collapses all consecutive whitespace (spaces, tabs, newlines) to a single space, removes whitespace between adjacent tags (`> <` → `><`), and removes extraneous spaces around tag-closing characters (`/` and `>`). The result is a compact, single-line SVG that is fully valid for use in `<img src>`, CSS `url()`, inline `<svg>`, and base64 data URIs. Compression ratio and exact byte savings are shown after each run. A download button saves the minified `.svg` file directly.
QDoes this remove unused SVG elements or attributes?
No — the minifier performs whitespace and comment removal only. It does not perform semantic SVG optimisation (such as removing hidden layers or unused defs). For deep SVG optimisation, consider SVGO via the command line.
QIs the output valid SVG?
Yes — removing whitespace and comments does not affect SVG semantics. The output is a fully valid, well-formed SVG document renderable by all modern browsers.
QCan I use the output as a data URI?
Yes — compact single-line SVG is safe for use in data URIs (`data:image/svg+xml,...`). URL-encode the output for maximum compatibility across browsers.
QIs my SVG sent to a server?
No. All minification runs locally in your browser. Nothing is transmitted to any server.