An SVG optimizer and editor that cleans up vector markup the way a build pipeline would, but instantly and entirely in your browser. Paste or upload an SVG and it strips the data that browsers never render — comments, editor metadata, empty and default attributes, redundant whitespace — rounds bloated coordinate numbers to a precision you choose, and reports the exact byte savings. It is built for designers exporting icons from Illustrator or Inkscape, developers inlining SVGs into a component, and anyone who just wants to know an SVG’s real dimensions without opening a heavy editor.
Vector files exported from design tools are notoriously wasteful. A single icon can carry kilobytes
of inkscape: and sodipodi: namespace junk, a <metadata> block, decorative whitespace, and
coordinates printed to fourteen decimal places like 120.000000000001. None of that affects the
rendered image, yet it inflates every page that ships the file. This tool removes it in one pass
and shows you the before-and-after size so the win is measurable, not guesswork.
How it works
The optimizer parses your markup with the browser’s native XML parser, so it understands real SVG
structure rather than guessing with regular expressions. It then walks the document tree and applies
the passes you have enabled: removing comment, metadata, title and desc nodes; deleting
editor-namespaced elements and attributes; dropping empty and default attributes such as
version="1.1" or x="0"; and rounding every coordinate-bearing value — path d data, points,
transform, radii and stroke widths — to your chosen decimal precision. Finally it serializes the
cleaned tree back to text, collapses the whitespace between tags, and optionally removes the XML
declaration and DOCTYPE. A live preview renders the result so you can confirm nothing broke, and the
metrics panel reports original size, optimized size, percent saved, the width, height and viewBox, and
the element and path counts. Everything — including your last input and toggle choices — stays on your
device.
Example
Take a 240×240 icon exported from a vector editor. The source weighs in with an XML prolog, a comment,
an inkscape namespace declaration, a metadata block, a <desc>, version="1.1" x="0" y="0", an
empty fill="", and coordinates like cx="120.000000" and r="100.123456". With the default passes
enabled, the optimizer deletes the comment, metadata and editor data, removes the redundant root
attributes, rounds 100.123456 to 100.12, collapses the indentation, and serializes a single tidy
line of markup.
| Pass | Effect |
|---|---|
| Strip editor data | Removes inkscape:/sodipodi: attributes and the xmlns:inkscape declaration |
| Remove metadata | Deletes metadata, title and desc nodes |
| Round coordinates | 100.123456 becomes 100.12 at precision 2 |
| Collapse whitespace | Joins indented lines into compact markup |
The result is typically 40 to 70 percent smaller, ready to copy straight into a component or save as
optimized.svg. Switch to the readable view first if you would rather keep the markup indented for a
codebase. No file is ever uploaded.