SVG Optimizer
Optimize and minify SVG code: strip comments, metadata and editor junk, round path numbers and see the bytes saved.
Drag & drop an SVG file here, or click to browse
No uploads. Your files stay on your device.
The optimized SVG could not be previewed, but the code above is still valid to copy.
How it works
Drop an .svg file or paste SVG markup and it is optimized instantly. The tool
parses the file with the browser's own XML parser, then removes the parts that only bloat the
download: comments, the XML prolog, <metadata> and <desc>
blocks, editor-only attributes and namespaces left behind by Inkscape, Illustrator, Figma or
Sketch, empty <g> and <defs> containers, and all the
indentation between tags. Long coordinates such as 38.3333333 are rounded to the
precision you choose, which is usually where most of the savings in a hand-exported icon come
from.
The size counter shows the original bytes, the optimized bytes and the percentage saved, and
the live preview lets you confirm the artwork still looks identical before you copy or
download it. Everything runs locally in your browser with DOMParser and
XMLSerializer โ nothing is uploaded, so unreleased logos and client artwork stay
on your device. Tip: start at 2 decimals, and only drop to 0 or 1 if the shape still looks
right in the preview.
Frequently asked questions
How does this SVG optimizer make files smaller?
It parses your SVG with the browser's XML parser and removes what only adds bytes: comments, the XML prolog, <metadata> and <desc> blocks, editor-only attributes and namespaces left by Inkscape, Illustrator, Figma or Sketch, empty <g> and <defs> containers, and all indentation between tags. It also rounds long coordinates such as 38.3333333 to the precision you pick, which is usually the biggest single saving in a hand-exported icon.
Is my SVG uploaded anywhere?
No. The whole optimization runs locally in your browser using DOMParser and XMLSerializer, so the markup never leaves your device. That makes it safe for unreleased logos, client artwork and internal icon sets, and it also means the tool keeps working offline once the page has loaded.
Will optimizing change how my SVG looks?
It should not. Only non-visual data is removed, and the live checkered preview shows the optimized result so you can compare it with the original before copying or downloading. The one setting that can visibly matter is number precision: at 0 or 1 decimal, very small or very detailed paths may shift slightly, so stay at 2 decimals if the preview looks off.