# SVG Optimizer and PNG Export

> Make SVG files smaller: remove metadata, comments and needless decimals, with a before and after comparison.

- Open in browser: https://pockettoolbox.org/en/svg-optimizer
- Runs entirely in your browser; files and input are never uploaded.

## How it works

Shrinks SVG graphics with a chosen precision and converts them to PNG if needed.

Drop SVG files or paste SVG code. The tool removes editor metadata (for example from Illustrator or Inkscape), comments, empty groups and needless decimals and shows original and result side by side with file size. Optionally fixed width and height are removed so the graphic scales, and embedded scripts are deleted. Save each file on its own, all together as a ZIP, or as a PNG at the width you need.

Optimization with SVGO 4 (browser build) and the preset-default plugin set, optionally with several passes (multipass). Precision controls floatPrecision for numbers and paths. Extra plugins: removeDimensions and removeScripts. Previews are shown as images via a blob URL, so scripts never run in the preview. PNG export via a canvas at the chosen width.

## FAQ

### How much smaller does an SVG get?

That depends on the program that created it. Exports from Illustrator or Inkscape often shrink by 30 to 70 percent because they contain a lot of metadata. Icons that are already optimized barely change.

### Does the graphic look different afterwards?

With the default precision (3 decimals) there is no visible difference. With fewer decimals very small details can shift slightly, for icons and logos even one decimal is usually not noticeable. The side by side comparison shows it right away.

### Why remove the fixed width and height?

Without width and height the graphic adapts to the space it gets in the layout, and the viewBox keeps the aspect ratio. For responsive websites that is usually what you want.

---
PocketToolbox (https://pockettoolbox.org/en)
