SVG Optimizer

Remove redundant SVG markup and shorten path data to make vector files smaller.

Input

Processed on your device

How to use SVG Optimizer

Ensure a vector graphic is compact enough for a web asset or inline markup. This optimizer applies SVG cleanup and lets you control path precision, multiple passes and removal or shortening of unreferenced identifiers.

  1. Paste SVG or open the local file.
  2. Choose Path precision, keep Repeat optimization if useful and enable Clean unreferenced IDs only when external references do not depend on them.
  3. Optimize, compare byte counts and preview before replacing the source.
Example input
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><rect x="5" y="5" width="50" height="50" rx="10" fill="#000000"/></svg>

Example use

Optimize a logo for a public website. Keep IDs when CSS or an anchor outside the SVG relies on a named object. For a standalone asset that uses no external selectors, try more aggressive optimization and compare the exact appearance at large and small sizes.

Output and compatibility

The browser sanitizes and optimizes the SVG. Some metadata or active constructs can be removed. Lower precision can visibly change paths, particularly in tiny coordinate systems or highly detailed graphics. An apparent match at thumbnail scale may hide a difference at large sizes.

Check the output as an image and as inline markup

Those two embedding modes can use different style and ID scopes. Inspect the same optimized file in the mode used by your actual site. Keep the original and preserve IDs when selectors or anchors depend on them.

Troubleshooting

If part of the graphic disappears, compare the original and output in SVG Viewer. Try higher precision and preserve IDs. Check whether removed attributes had meaning to a specific renderer or referenced content outside the file.

For a downloadable raster preview, try SVG to PNG.

Frequently asked questions

Will it convert my SVG to pixels?

The output is SVG markup with vector geometry where present.

Can I keep IDs referenced by a stylesheet?

Leave Clean unreferenced IDs off and verify the intended references.

Does it always save bytes?

The result depends on original encoding and settings. The tool reports the actual before and after size.

What does Path precision control?

It controls numeric precision for geometry. Lower values can reduce bytes and alter shapes.

Is this an SVG editor?

Use it for a cleaned export. Keep the original for detailed design edits.

Find a tool