Clean up and shrink an SVG file

An icon exported from a vector editor is often ten times larger than it needs to be. This removes what the editor added and leaves the geometry as it was.

How SVG Optimizer works

Colours, gradients and spacing are converted into CSS text you can copy. The page never renders your design on anyone else's screen. Paste the values into your own stylesheet and the result is byte-identical to what the preview showed.

That is the whole architecture: static files, one script, no upload endpoint to leak or log. Close the tab and the work is gone.

Where the bytes hide

A vector editor writes far more than the drawing. It stamps a generator comment, a metadata block with the document history, a namespace per plugin, and attributes like inkscape:label on every group. None of it is needed to render the icon, and on a small file it can be most of the weight.

The second culprit is precision. Coordinates written to six decimals are meaningless below a tenth of a pixel at any realistic size, so rounding to two decimals usually removes a fifth of the file without a visible difference.

What an optimiser must not touch

Identifiers are load-bearing. An id can be referenced by a gradient, a clip path, an aria-labelledby attribute, or by CSS and JavaScript elsewhere on the page — removing it because it looks unused breaks the icon in a way that only shows up in the browser.

Class names matter for the same reason when the SVG is inlined and styled from the page's stylesheet. This tool leaves both alone and only removes comments, editor metadata, empty groups and worthless attributes. The shapes are never re-traced or simplified.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Does it change the drawing?

No. Coordinates are rounded to the number of decimals you choose, which can shift a curve by a fraction of a pixel. No path is simplified or re-traced.

What gets removed?

Comments, <title>/<desc>/<metadata>, empty groups, editor-specific attributes (inkscape, sodipodi, adobe, illustrator) and useless style attributes.

Why remove width and height?

An SVG with a viewBox and no fixed size scales to its container, which is usually what you want for a web icon. Untick the option to keep them.

How much smaller does it get?

Typically 20–60% on editor exports. Icons drawn by hand are already lean, so expect little.

Keep going

More design tools