Crop SVG to Bounding Box

Set viewBox to the tight content box (no 2% pad) — different from Crop SVG Online

Calculate bounding box? Calculate bounding boxCrop SVG? Crop SVG

FAQ

Quick answers

How is crop SVG to bounding box different from Crop SVG Online?
Crop SVG Online adds a small pad. This page uses a tight bounding box with no pad ratio so the canvas hugs the paint.
Does crop-to-bbox change path coordinates?
No. Only viewBox (and root size attrs). Points stay in the same user space.
What if I only want the numbers, not a crop?
Use Calculate SVG Bounding Box Online — it reports x/y/width/height without rewriting viewBox.
Will stroke width be included in the bounding box?
Yes. Measurement includes stroke outset so outlines are not clipped.
Calculate bounding box → Crop SVG → Calculate viewBox →
Open full editor →

Source

Type or paste SVG markup. The preview on the right updates as you type.

Ready

Live preview

PNG export · 2× for retina