SVG Path Data Minifier & Optimizer
Reduce noisy SVG path data, compact coordinates, and generate smaller inline SVG output.
Minifier
Results
Metrics
Introduction
Design tools often export SVG paths with excessive decimal precision, redundant line commands, and unnecessary whitespace. This increases markup size without improving visual quality.
This minifier cleans path data locally and produces a more compact SVG output.
How it works
The tool parses SVG path commands, rounds coordinates to the selected precision, converts simple line commands into horizontal or vertical commands where possible, and serializes the result with compact formatting.
- Full SVG markup is processed with DOMParser.
- Raw path data is accepted directly.
- Zero-length segment removal is optional.
- All processing happens locally.
How to use
- Paste full SVG markup or path data.
- Select coordinate precision.
- Optionally remove zero-length segments.
- Click Optimize SVG.
- Copy the optimized output.
Practical example
A path exported as
M 10.000000 10.000000 L 50.000000 10.000000 L 50.000000 50.000000
can often be reduced to M10 10H50V50.
Use cases
- Cleaning icon exports.
- Reducing inline SVG size in HTML.
- Preparing design-system assets.
- Optimizing UI illustrations.
- Reviewing SVG output before committing code.
Best practices
- Use the lowest precision that preserves visual quality.
- Check icons at small sizes after rounding.
- Keep zero-length segments if they are intentional.
- Compare optimized output visually before deployment.
- Use SVG sprites where many icons repeat.
Common mistakes
- Rounding too aggressively and distorting curves.
- Removing zero-length segments used for markers.
- Optimizing only one icon variant without checking others.
- Assuming all design-tool exports are already optimized.
- Forgetting to test dark-mode stroke visibility.
Limitations
- Rounding can slightly alter rendering.
- Complex arc paths may require manual review.
- The tool does not optimize filters, gradients, or groups.
- Path simplification does not remove redundant points from curves.
Browser compatibility
The optimized path syntax is standard SVG path syntax and works in current versions of major browsers.
FAQ
Is my SVG uploaded?
No. SVG markup and path data are processed locally in your browser.
Will optimization change the visual result?
Small rounding changes can occur. Use a precision level that preserves visual quality and verify the output.
Can I paste only a `d` attribute?
Yes. The tool accepts raw path data as well as full SVG markup.
Does it optimize filters or groups?
No. This tool focuses on path data. Filters, gradients, symbols, and groups are not optimized.