Skip to content
Toolbench

SVG Optimiser

Strip what an editor left behind — metadata, comments, fourteen-decimal coordinates — without changing what the file draws.

Runs entirely in your browser

Loading tool...

How to use

  1. Open the .svg file in a text editor and paste its contents here.
  2. Leave the defaults on; they remove only what does not draw.
  3. Lower the decimals if the file is mostly path data and still large.
  4. Check the preview in your design before shipping — precision is the one setting that can change appearance.

Features

  • Removes comments, XML declaration, doctype and editor metadata.
  • Strips namespaced attributes left by Inkscape, Sketch and Illustrator.
  • Rounds long coordinates to a precision you choose.
  • Removes width and height only when a viewBox remains, so the image keeps its size.
  • Runs entirely in your browser.

Frequently asked questions

Where does all the extra weight come from?
Editors. An SVG exported from a design tool carries its own metadata block, a doctype nobody reads, the editor's namespaced attributes recording its window position, and coordinates written to fourteen decimal places because a rotation happened. On a typical icon that is most of the file, and none of it reaches the screen.
Is rounding coordinates safe?
At two decimals, on any normal size, yes — the difference is a hundredth of a pixel. It becomes visible when the viewBox is small and the image is scaled up a great deal, which is why it is a setting rather than a fixed choice. Look at the result before shipping.
Why keep width and height by default?
Because removing them changes how the image behaves when it has no CSS size: with a viewBox it scales to its container, without those attributes it may collapse or fill unexpectedly. The option is there when you know your SVG is styled, and it refuses to act when there is no viewBox to fall back on.

Strip comments and whitespace from a stylesheet without touching what is inside a string or a data URI.

Crop, resize and compress a batch of photos, with optional AI watermark removal.

Mock-up images as SVG data URIs — no third-party request, no broken prototypes when the service disappears.

Rasterise an SVG at any size, sharp — the vector is drawn at the size you ask for, not scaled up afterwards.

SVG Optimiser — Clean and Shrink an SVG