Remove viewBox (removeViewBox)
Strips the viewBox attribute so width and height alone define layout. That often saves bytes but breaks responsive scaling when CSS only sets one dimension.
What Remove viewBox does in SVGO
SVGO applies removeViewBox as part of its plugin pipeline. In SVGOMG the toggle is labeled Remove viewBox (enabled by default). Optimization runs entirely in your browser — files are not uploaded to a server.
Use the SVGOMG optimizer with Show original to compare before and after. If output looks wrong, disable this plugin first, then re-enable related transforms one at a time.
When to enable
Fixed-size icons and assets that never scale (favicons, pixel-perfect UI sprites).
When to disable
Responsive SVGs, logos in fluid layouts, or anything using CSS max-width with only a viewBox for aspect ratio.
Watch out for
After removal, the graphic may render at the wrong size or clip unexpectedly in browsers.
Try it in SVGOMG
- Open svgomg.net and load your SVG (file, paste, or demo).
- Find Remove viewBox in the Features panel (
removeViewBox). - Toggle the plugin and compare the preview; download when satisfied.
SVGO Plugin Guide
Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough on the homepage.