SVG Optimizer
Optimize SVG files with SVGO in your browser. Compare before and after previews, check the bytes saved and download the result.
🔒 Runs entirely in your browser — nothing is uploadedWhy optimize SVG files
SVG files exported from design tools such as Illustrator, Figma, Sketch or Inkscape contain much more than the shapes you see. Editor metadata, XML comments, hidden layers, default attribute values, unused definitions, excessive decimal places and redundant groups can easily make up half of the file. This tool runs SVGO — the same optimizer used by most build pipelines and icon libraries — to remove that overhead. Smaller SVGs load faster, make inline icons lighter in your HTML and keep repositories tidy.
The default preset applies dozens of safe transformations: it removes the XML declaration, comments, metadata and editor namespaces, cleans up IDs, shortens colors, merges paths, converts basic shapes to compact paths when that is shorter and rewrites path data with relative commands and fewer digits. Multipass repeats the process until no further savings are found, which often squeezes out a few extra percent.
Choosing the options
Precision controls how many decimal places are kept in numbers; 2–3 suits icons, while detailed illustrations or maps may need more. Remove <title> saves bytes but removes the accessible name, so keep it for meaningful graphics. Remove viewBox should normally stay off, because the viewBox is what lets an SVG scale responsively. Remove width/height is useful when CSS controls the size. Remove scripts & event handlers strips <script> elements, on* attributes and javascript: links, which is a good habit for SVGs from unknown sources. Pretty print indents the result for readability at the cost of a few bytes.
Private, local and safe previews
All processing happens in your browser; files are not uploaded. Both previews are displayed through an image element that loads a local blob URL, and browsers never execute scripts inside SVGs shown this way. Always compare the two previews before using the output: aggressive precision or removing the viewBox can change how a graphic renders. The size badges show the byte savings so you can balance file size against visual fidelity.
How to use
- Add an SVGDrop an .svg file or paste SVG markup into the input.
- Choose optionsSet multipass, precision and optional removals such as title, viewBox or width and height.
- Optimize and compareClick Optimize SVG and compare the original and optimized previews and sizes.
- DownloadCopy the markup or download the optimized .svg file.