SVG Optimizer

Make icons and logos load faster by removing everything the browser doesn't need.

Number precision

How to optimise an SVG

  1. Choose one or more SVG files (up to 10 MB each), or paste SVG code.
  2. Pick the number precision and, if you like, Prettify, Responsive or Keep IDs. The result updates straight away.
  3. Press Show original to compare, then copy the code or download it as .min.svg (several files come as a ZIP).

What gets removed

The tool uses SVGO, the widely used open-source SVG optimiser, with its standard safe settings, run several times until nothing more can be saved. It removes editor metadata, comments, hidden and empty elements, and unnecessary precision in numbers, and it shortens paths and colours. It also removes any <script> elements and event handlers, so the file can't run code when it's shown on a web page.

How much smaller?

SVGs exported from design tools carry a lot of editor information, so they often shrink noticeably. Hand-written or already optimised icons may barely change. The result shows the exact saving for your file, plus the gzipped sizes, which is what most web servers actually send.

Tips

  • Compare the optimised file with the original before replacing it, especially for complex illustrations.
  • Keep IDs on when your CSS or JavaScript targets elements inside the SVG by id.
  • Keep the original from your design tool; the optimised file is for publishing, not editing.
  • For a favicon, convert a PNG version with the ICO converter.

Frequently asked questions

How much smaller will my SVG be?

It depends on the source. Files exported from design tools often shrink noticeably; hand-written SVGs may barely change. The tool shows the exact saving, and the gzipped size a web server would send.

Which number precision should I pick?

3 decimal places (the default) is safe for most icons and logos. 1 or 2 makes files smaller but can bend curves on small, detailed icons; compare with Show original before you use it.

What does Responsive do?

It removes the fixed width and height and keeps the viewBox, so the SVG scales to the size of its container in CSS instead of being stuck at one size.

Why remove scripts from an SVG?

SVG files can contain JavaScript that runs when the image is opened directly in a browser. Removing scripts makes an SVG from an unknown source safer to publish.

Is my file uploaded?

No. SVGO runs in your browser.

More image tools

See all image tools →

Can't find the tool you need? Tell us.