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. This plugin is a common cause of broken responsive SVGs; see the Transforms that can break SVGs topic guide.
What Remove viewBox does in SVGO
SVGO applies removeViewBox as part of its plugin pipeline. On SVGOMG.net the toggle is labeled Remove viewBox (enabled by default). Optimization runs entirely in your browser — files are not uploaded to a server.
Use SVGOMG.net 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
- 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.
Part of: Transforms that can break SVGs
This plugin is covered in the Transforms that can break SVGs topic guide along with related transforms.
SVGO Plugin Guide
Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough.