SVG Crop & Trim Tool
Trim empty SVG canvas space automatically. Measure rendered geometry with getBBox(), add custom padding, crop the viewBox, and export locally.
1 Source & crop
Native geometry measurement2 Cropped SVG
Tight viewBox outputYour file is processed on this device and never uploaded.
How it works
From input to output,
in a few clicks.
Remove unused space around an icon or illustration without redrawing its coordinates. This tool measures the actual geometry in an isolated browser document, expands that boundary by your chosen padding, and writes a tightly framed viewBox.
- Add your SVGUpload a file or paste valid SVG markup with an SVG-namespace root element.
- Set the crop spacingEnter non-negative padding in SVG user units and choose whether width and height should match the trimmed viewBox.
- Measure and exportRun the crop to compare the old and new viewBox values, inspect the preview, then copy or download the result.
Good to know
Frequently asked questions
How does automatic SVG cropping work?
The browser renders the SVG in a hidden sandboxed document and calls getBBox() on its root. That native geometry boundary is offset by your padding and used as the new viewBox; no artwork is embedded in the host page.
Does getBBox include stroke width?
The standard getBBox() geometry box does not include stroke or filter effects. Add enough padding to accommodate thick strokes, markers, shadows, or other visual effects around the geometry.
What happens to an empty SVG?
The tool stops with an explanatory message when the measured width or height is zero or non-finite. It will not create an invalid zero-sized viewBox, so you can correct the source and try again.