About SVG Optimizer

SVG Optimizer makes SVG files smaller without changing how they look. Design tools such as Inkscape, Illustrator, Figma and Sketch add comments, metadata, long numbers and unused definitions that browsers do not need. Drop your files or paste the code, choose what to strip, and see the size before and after.

It is built on SVGO, the standard SVG optimizer, running inside your page. You can compare the original and optimized image side by side, copy the optimized code, and download one file or a ZIP of many.

Your files never leave your device: the work happens in your browser, with no upload and no account. It is free and adds no watermark.

How to optimize an SVG

  1. Add one or more SVG files, or paste SVG code.
  2. Turn the options on or off and set the decimal places.
  3. Check the preview, then copy the code or download the file or ZIP.

Frequently asked questions

What does the SVG Optimizer remove?

Comments, metadata, editor data from Inkscape, Illustrator and Sketch, the XML prolog and doctype, empty attributes and groups, unused definitions and unused ids. Each one is a switch you can turn off.

Will my SVG look different afterwards?

It should look the same. Numbers are rounded to the decimal places you choose (3 by default), which is invisible at normal sizes. If a very small or very large drawing looks off, raise the decimal places or turn rounding off.

Are ids that gradients and filters use kept?

Yes. Only ids that nothing refers to are removed, so gradients, clip paths, masks and links keep working.

Why remove width and height?

With only a viewBox the SVG scales to whatever size its container gives it, which suits responsive layouts. It is off by default because it changes how the image is sized.

Can I optimize many SVG files at once?

Yes. Add them all, and download a ZIP, or open any file to copy its code or download it on its own.

Is it safe to open SVG files from other people?

Your file is shown as an image, which never runs scripts, and is never added to the page. The option to remove scripts and event handlers is on by default, so the optimized file is clean too.

Are my files uploaded?

No. The optimizer runs in your browser and your files never leave your device.