SVG Optimizer
Clean and shrink SVG files by removing editor metadata, comments and redundant whitespace, locally in your browser.
Loading SVG Optimizer… If nothing happens, please enable JavaScript.
SVG, short for Scalable Vector Graphics, is an XML-based format for two-dimensional graphics that describes shapes as mathematical paths rather than a grid of pixels. Because it is text, an SVG scales to any size without blurring, compresses well with gzip, can be styled with CSS, animated, and edited in a plain text editor. The catch is that the SVG files exported by design tools are rarely lean. Editors like Inkscape, Illustrator, and Sketch pack their output with private namespaces, editing history, generator comments, document metadata, and generous indentation, all of which the browser ignores when it renders the image but still has to download and parse.
Frequently asked questions
Is my SVG sent to a server?
What exactly does the optimizer remove?
Will optimizing change how my image looks?
Should I keep the title element?
Why are Inkscape and Illustrator files so much larger than they need to be?
How much smaller will my file get?
Does this also minify or rewrite the path data?
Can I paste SVG code instead of uploading a file?
About SVG Optimizer
This optimizer strips that cruft away. It parses your SVG with the browser's own DOMParser, which understands the XML structure properly rather than chopping at it with fragile regular expressions, then walks the tree and removes comment nodes, metadata and desc elements, optional title elements, and editor-specific elements and attributes such as the inkscape and sodipodi namespaces. It deletes the XML declaration and any doctype, and optionally collapses the redundant whitespace between tags. The cleaned tree is serialised back to valid SVG with XMLSerializer, so the result is still a well-formed document you can drop straight into a web page or an icon system.
You can paste markup directly into the editor or upload a .svg file, and the tool shows the original byte size, the optimized byte size, and the percentage saved in real time as you toggle options. The output appears in a second panel ready to copy to your clipboard or download as a new file. For typical editor exports the savings are substantial, often between thirty and seventy percent, with no visible change to the rendered image because only non-rendering data is removed.
Everything runs entirely in your browser. The SVG never leaves your device, there is no upload, no server, and no account, so the tool is safe for proprietary icons, brand assets, and confidential diagrams. It also keeps working offline once the page has loaded. The optimizer is deliberately conservative: it removes data that does not affect rendering rather than rewriting path geometry or rounding coordinates, which means the visual output is preserved exactly while the file gets meaningfully smaller.
How SVG won the vector format war
SVG was not the only contender for vector graphics on the web. In the late 1990s Microsoft and others backed VML, the Vector Markup Language, while Adobe and Sun pushed PGML, the Precision Graphics Markup Language. The World Wide Web Consortium took both proposals, convened a working group, and merged the best ideas into a single open standard. SVG 1.0 became a W3C Recommendation in September 2001, but adoption was slow because Internet Explorer, then the dominant browser, supported only VML and required a plugin for SVG.
The turning point came with the other browsers. Firefox, Safari, and later Chrome shipped native SVG rendering through the 2000s, and when Internet Explorer 9 finally added native support in 2011 the format had universal reach. The rise of high-density Retina displays around the same time made SVG suddenly essential: a single vector icon stays razor sharp on any pixel density, while bitmap icons need multiple exports and still blur on screens they were not made for. Icon fonts had a brief moment, but SVG icons proved more accessible and more flexible and largely replaced them.
Because SVG is just XML text, it inherited both the strengths and the bloat of XML tooling. Design applications treat the file as a project document and stuff it with their own private data, which is why an icon that renders as a few hundred bytes of essential path data can ship as several kilobytes of editor metadata. Optimizing SVGs has therefore become a standard build step in modern front-end workflows, and doing it safely, by parsing the real document tree rather than guessing with text replacement, is what separates a reliable cleaner from one that occasionally corrupts your art.