Skip to content
Jellykit

SVG Optimizer

Shrink SVG files by stripping editor metadata and comments and rounding coordinates, with a before and after preview.

  • Runs on your device
  • Works in the background
Loading tool

About SVG Optimizer

Drawing programs save SVGs full of things a browser never uses: editor settings, layer names, comments, empty groups, default attribute values and coordinates written to six decimal places. This tool removes them with svgo, the optimizer most build pipelines use, and shows the original and the optimized drawing side by side so you can check that nothing visible changed.

Choose how many decimal places to keep, whether to keep ids that outside CSS relies on, and whether to strip scripts and event handlers too. The result can be copied or downloaded as a file.

How it works

  1. Your markup is passed to svgo with its default preset, which removes metadata, comments, hidden and empty elements and redundant attributes, shortens colors and rewrites paths in their most compact form.
  2. Numbers are rounded to the decimal places you choose. With repeat on, the passes run again until the file stops getting smaller.
  3. The work runs in a background worker, and the before and after previews are drawn as images, so no script in the file runs.

Questions

Will the optimized SVG look different?

With the default settings it should not. Rounding to fewer decimal places can shift fine details in very small or very detailed drawings, which is why the preview shows both versions. Raise the decimal places if you see a change.

Why did my ids disappear?

Ids that nothing inside the file uses are removed and the rest are shortened. If a stylesheet or script outside the file targets elements by id, turn on Keep ids.

Does it make an SVG safe to embed?

Not by itself. Turning on Remove scripts and event handlers drops script elements, on… attributes and javascript: links, but that is not a full sanitiser. Check untrusted files with the SVG Inspector as well.

Is there a size limit?

Up to 10 MB of markup, pasted or opened. Larger files are refused with a message so the page does not freeze.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.