SVG OptimizerShrink your SVG, keep it sharp

Drop an SVG file and get a smaller, cleaner copy that looks exactly the same.

Make SVG files smaller and safer: strip editor metadata, round coordinates, merge paths and remove scripts and event handlers. See the size before and after.

  • SVGO-based optimization
  • Script and event-handler removal
  • Precision control
  • Responsive viewBox option
A round star logo: the left half is the original bitmap, the right half is the traced SVG with smooth edges

Optimize an SVG

Drop an .svg file, paste SVG code anywhere on the page, or choose a file. It is sanitised and optimised on this device.

SVG optimizer

Shrink and sanitise any SVG for the web — editor clutter removed, coordinates rounded, unsafe content stripped — with the size before and after.

Where the bytes go

Design apps write SVG for themselves: editor namespaces, layer metadata, hidden guides, coordinates to six decimal places and groups nested inside groups. None of it affects what the browser draws. On a typical exported icon, half the file or more is this kind of baggage.

The optimizer runs SVGO — the standard open-source SVG optimizer — with settings you can see and change. Each toggle names what it does in plain words, and the before, after and saved figures update as you go.

Why sanitising matters

SVG is a document format, not just a picture format. It can contain scripts, links and embedded content, which is why many platforms refuse SVG uploads entirely. Every file opened here is sanitised before preview: scripts, event handlers, external references and foreign content are removed and listed. The download is the sanitised version.

Choosing precision

  • 0–1 decimals for icons drawn on a large viewBox, such as 0 0 1024 1024.
  • 2 decimals for most illustrations and logos.
  • 3 or more for tiny viewBoxes, such as 0 0 24 24, where a tenth of a unit is visible.

Other SVG tools

Optimizer questions

Will optimizing change how my SVG looks?

Not at the default settings. Precision is the one control that can: very low precision moves points visibly on small icons. The live preview updates as you change it, so compare before you download.

What does sanitising remove?

Scripts, event-handler attributes such as onclick, foreignObject content, links to javascript: addresses, and references to external files. What was removed is listed, so nothing disappears silently.

Is my SVG uploaded?

No. The file is read and optimized in this tab with the open-source SVGO library, bundled into the page.

Should I use the responsive option?

Use it for SVGs placed in web layouts with CSS sizing; it removes fixed width and height and keeps the viewBox. Keep dimensions for files going to print or design apps.