Fix SVG viewBox Not Working

Repair missing or invalid viewBox so the SVG scales again

Need numbers? Calculate SVG viewBoxWrong crop? Fix SVG viewBox cropping

FAQ

Quick answers

Why is my SVG viewBox not working?
Common causes: the attribute is missing, the four numbers are invalid, or width/height alone drive sizing while viewBox is absent.
How do I fix a missing SVG viewBox?
Paste the file here and click Fix viewBox. The tool measures shapes and writes a valid viewBox automatically.
Can invalid viewBox values break scaling?
Yes. Zero or non-numeric sizes prevent predictable scaling. This tool replaces them with measured content bounds.
Should I keep width and height if viewBox was missing?
After repair, root width and height are removed so the new viewBox controls scaling cleanly.
Calculate viewBox → General fix → 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