Path and shape optimization
Path-heavy SVGs benefit from coordinate rounding, shape conversion, and group flattening. These plugins deliver the biggest size wins on complex illustrations but deserve a visual check after enabling — especially convertPathData and mergePaths.
SVGO plugins in this topic
- Round/rewrite paths
convertPathDataRewrites path commands with fewer digits and simpler curves. Usually one of the largest wins on complex illustrations.
- Merge paths
mergePathsCombines paths that share styling into fewer elements, reducing DOM size inside the SVG.
- Shapes to (smaller) paths
convertShapeToPathConverts rect, circle, ellipse, and line elements to path equivalents, often smaller after path rounding.
- Convert non-eccentric <ellipse> to <circle>
convertEllipseToCircleReplaces ellipses with equal radii by <circle> elements, which are more compact.
- Round/rewrite transforms
convertTransformOptimizes transform attributes: shorter matrix notation, combined operations, fewer decimals.
- Collapse useless groups
collapseGroupsRemoves unnecessary wrapper <g> elements that do not affect rendering.
- Move attrs to parent group
moveElemsAttrsToGroupHoists common child attributes up to parent <g> elements to reduce duplication.
- Move group attrs to elements
moveGroupAttrsToElemsPushes group-level presentation attributes down to children when that yields smaller output.
- Remove out-of-bounds paths
removeOffCanvasPathsRemoves paths entirely outside the viewBox clipping region.
Related topics
Try it
Open SVGOMG.net, load your SVG, and toggle the plugins above in the Features panel.