Fit SVG to viewBox

Make the viewBox hug the artwork so the graphic fills the frame

Trim padding only? Remove whitespaceCompute values? Calculate SVG viewBox

FAQ

Quick answers

What does fit SVG to viewBox mean here?
The viewBox is rewritten to the content bounds (with a slight pad) so the artwork fills the SVG frame instead of floating in empty space.
Does fitting scale or move my paths?
No. Paths stay put. Only the viewBox window moves and resizes around them.
When should I fit instead of only removing whitespace?
Use fit when you want the frame aligned to the art for export or UI icons. Use Remove whitespace when you specifically want a zero-pad crop.
Are width and height kept after fitting?
No. They are stripped so layout sizing comes from the fitted viewBox.
Remove whitespace → Calculate viewBox → Change 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