Skip to content
ToolMug

SVG Optimizer

Compress SVG files with SVGO in your browser. It removes the metadata, comments and redundant attributes that Illustrator, Inkscape and Figma add on export and shortens path data and decimals, so the graphic stays the same and the file gets smaller. Process several files at once or paste SVG code.

Runs in your browser — nothing you enter is uploaded

3

Coordinates are rounded to this many decimals. 2–3 is invisible for most icons; lower is smaller but may distort detail.

or drop files here

Or paste SVG code
Optimized SVG

How to use

  1. Choose or drop SVG files (several at once if you like), or paste SVG code below. Click Load sample to see it work.
  2. Adjust the decimal places and other options. Results update immediately and show how much smaller each file is.
  3. Download each optimized file or click Download all (ZIP). Pasted code can be copied directly.

Options explained

Decimal places
How many decimals coordinates and numbers keep, 3 by default. Icons usually look the same at 1–2; keep 3 or more for detailed illustrations and maps.
Run several passes
Repeats the optimization until the file stops shrinking. Often saves a few more percent and takes slightly longer.
Remove width/height
Keeps only the viewBox so the SVG scales with its container — useful when you size it with CSS.
Keep IDs
By default unused IDs are removed and the rest shortened. Tick this if external CSS, JavaScript or other files refer to elements by ID.

Example

The original (exported from Inkscape, 789 bytes) contains an XML declaration, a comment, metadata, editor-only attributes and long decimals. Optimized (248 bytes):

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><circle cx="60" cy="60" r="50" style="fill:#0f766e;fill-opacity:1;stroke:none"/><path d="m40 62 14 14 28-30-6-6-22 24-8-8Z" style="fill:#fff;stroke:none"/></svg>

Frequently asked questions

Will the image look worse?

SVG is a vector format. Optimization only removes content that does not affect rendering and rounds numbers to the chosen decimals. With the defaults there is no visible difference; if a shape distorts, increase the decimal places.

How much smaller will it get?

It depends on the software that exported it. SVGs from design tools often shrink by 30–70% — the sample goes from 789 to 248 bytes. Files that were already optimized change little.

Why did an animation or script stop working?

If the SVG's styles or scripts select elements by ID, tick Keep IDs.

Are my files uploaded?

No. SVGO runs in your browser; files are read and processed locally.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools