Skip to content
Documentation

What is SVGM?

SVGM (SVG Minimizer) is an SVG optimizer written in Rust. It takes SVG files exported from tools like Figma, Illustrator, and Inkscape, strips metadata, redundant attributes, and verbose path data, and produces smaller, cleaner output.

Native performanceFixed-point convergenceSafer defaultsSingle binary

Why another SVG optimizer?

SVGO has been the standard SVG optimizer for years. SVGM takes a different approach: a ground-up rewrite in Rust, designed around fixed-point convergence and conservative defaults. Like oxlint for ESLint, SVGM targets the same problem with a different architecture.

Fixed-point convergence

In some optimizers, running multiple passes can still reduce output further because later passes create opportunities for earlier ones. SVGM solves this by running all 24 optimization passes in a loop over the in-memory AST until the document stabilizes. Once no pass reports a change, optimization is complete.

$ svgm icon.svg icon.svg 13.5 KiB -> 6.6 KiB (51.1% smaller) 0ms 3 passes

No re-parsing between iterations. No manual multipass flag. One invocation, fixed-point optimization. Typically converges in 1 to 3 passes, with a safety limit of 10.

Architecture

parse optimize serialize SVG string ---------> AST tree ---------> AST tree -----------> SVG string xmlparser fixed-point minified loop output
  1. 1. Parse xmlparser tokenizes the SVG into an arena-based AST with parent pointers.
  2. 2. Optimize All passes run in a loop until no pass reports a change (max 10 iterations).
  3. 3. Serialize The AST is written back as a minified SVG string.

Passes operate directly on the in-memory AST, avoiding repeated serialize/parse cycles between iterations.

Current status

SVGM v0.2.0 ships 24 optimization passes, three safety presets, config file support, a CLI, and a Rust crate API. It is 2.6x faster than SVGO with safer defaults. JavaScript and WASM bindings are on the roadmap.

v0.2.024 passes3 presetsCLIRust crateJS/WASM planned