Skip to content
OneTooling

SVG Optimizer

Shrink SVG files with SVGO. Paste code or drop many files, compare before and after, and download as one ZIP. Files never leave your browser.

Runs in your browser · nothing uploaded

Drop files here, or

One or many .svg files. They stay on your device.

Options

Fewer decimals give smaller files. 2 or 3 suits most icons; use more for large or very detailed drawings.

Deletes <!-- comments -->.

Deletes <metadata> and the extra data Inkscape, Illustrator, and Sketch add.

Off by default: screen readers can read <title> and <desc>.

Needed for the image to scale. Leave on unless you know you do not need it.

Makes the SVG fill the size its container gives it.

Turn off if your CSS or scripts refer to IDs inside the SVG.

Deletes <script> and onclick-style attributes.

Slower, sometimes a little smaller.

Indented and readable, but larger.

Paste SVG code or choose files to shrink them. Results appear here.

Why is there an ad? This tool is free and runs on your device. One small ad pays for hosting and new tools. No pop-ups, no autoplay, never inside the tool. How we make money

How to optimize an SVG

  1. Paste SVG code into the box, or choose one or more .svg files.
  2. Adjust the options if you want to. The result updates by itself, with the size before and after and a picture of each.
  3. Copy the optimized code, download the file, or download all files together as a ZIP.

SVGs exported from design tools often carry editor data, comments, and long numbers that browsers do not need. Removing them commonly makes icons and logos 30 to 70 percent smaller. If the Optimized preview looks different from the Original, raise the number precision or turn off the option you suspect.

Questions

Are my SVG files uploaded?

No. SVGO runs in your browser, in a background thread. Your files are read and optimized on your device and are never sent to a server.

Will optimizing change how my SVG looks?

It should look the same. The default settings remove only data that does not affect drawing, and round numbers to 3 decimal places. Compare the Original and Optimized previews, and raise the number precision if a detailed drawing looks slightly off.

Why is "Keep viewBox" on by default?

The viewBox lets an SVG scale to any size. Without it, an image with a fixed width and height cannot be resized with CSS. Turn it off only if you have checked that your SVG still scales the way you need.

Why do some of my icons break after optimizing?

The usual cause is shortened IDs, when CSS or JavaScript elsewhere refers to an ID inside the SVG. Turn off "Shorten and clean up IDs" and optimize again. SVGs that rely on <style> rules for classes keep working with the default settings.

Can I optimize many files at once?

Yes. Choose or drop several SVG files, see the saving for each, and press "Download all as ZIP". Optimized files are named like logo.min.svg, so your originals are never overwritten.

Credits

Built on SVGO (MIT). OneTooling is not affiliated with that project.