Design tools

SVG Optimizer

SVG Optimizer

Minify and clean SVG files with SVGO: smaller files, same look, side-by-side check.

About this tool

About SVG Optimizer

SVG exported from Illustrator, Figma, Inkscape or Sketch carries a lot of weight a browser never needs: editor metadata, comments, hidden layers, default attributes, over-precise coordinates and long colour values. This optimizer runs SVGO, the standard open-source SVG optimizer, directly in your browser to strip all of that, which often makes exported icons and illustrations much smaller. You stay in control of what changes. Set the number precision, keep ids when your CSS or JavaScript targets them, keep the description for accessibility, remove width and height so the graphic scales with CSS, or pretty-print the result for reading. Scripts and event handlers are removed by default, which makes untrusted uploads safer to inline. Before and after previews sit side by side so you can confirm nothing shifted, and the saving is shown in bytes and percent. Drop many files at once and download them all as a ZIP. Nothing is uploaded.

Built and maintained by Abhi JainUpdated

How to Optimize an SVG

  1. 1

    Add SVG files

    Drop one or more .svg files, or paste SVG code and press Use code.

  2. 2

    Choose options

    Set the number precision and tick the cleanups you want. The result updates instantly.

  3. 3

    Compare and save

    Check the before and after previews, then copy the code, download the file, or download all files as a ZIP.

SVG Optimizer: questions and answers

Will optimizing change how my SVG looks?

With the default settings it shouldn't. Very low precision (0–1 decimals) can move points on small icons, so compare the before and after previews and raise the precision if anything shifts.

What is SVGO?

SVGO is the widely used open-source Node.js tool for optimizing SVG. This page runs its browser build, so you get the same results without installing anything.

Should I remove width and height?

Remove them when you want the SVG to size itself from CSS, for example an icon that fills its container. The viewBox is kept, so it still scales correctly.

Why keep ids?

Optimization shortens or removes ids that the file doesn't reference itself. If your stylesheet, JavaScript or a <use> element in another file targets an id, keep ids on.

Does it remove malicious code?

Remove scripts and event handlers is on by default and strips <script> elements, on… attributes and javascript: links. Check the result in the SVG Viewer for a full safety report.