Skip to main content
Nonkera

SVG Optimizer & Minifier

Developer Tools

Paste raw SVG markup exported from Illustrator, Figma, or Inkscape and strip out comments, editor metadata, and excess numeric precision to produce a smaller, cleaner SVG — optimized entirely in your browser, with a live before/after preview and size comparison.

Why exported SVGs carry so much extra weight

An SVG saved straight out of Illustrator, Figma, Sketch, or Inkscape rarely contains just the drawing itself. Design tools routinely embed their own metadata alongside the actual paths: an editor-specific XML namespace (inkscape:, sodipodi:, or similar), a <metadata> block describing the authoring application and document history, HTML comments left over from the editor's export process, and coordinate values carried out to eight or ten decimal places of precision that no screen will ever render a meaningful difference for. None of it affects how the SVG looks — it's overhead that exists purely because the file passed through a particular piece of software on its way to you.

For a one-off illustration this rarely matters. For an icon system where the same SVG might be inlined dozens of times across a page, or for a favicon and logo that load on every single page view, that extra weight adds up in a way that's easy to overlook until you actually compare file sizes before and after cleanup.

What this optimizer removes

The tool works directly on the parsed SVG document, not on the raw text, so it can reliably target specific things: XML comments, the editor-specific namespaced attributes and elements that Illustrator, Inkscape, and similar tools attach (things like inkscape:label or sodipodi:role, which have no effect on rendering), empty <g> and <defs> elements left behind after other cleanup, and needless whitespace between tags. It also rounds numeric coordinate and path data to a configurable number of decimal places — two by default, which is enough precision to be visually indistinguishable from the original in virtually every case while meaningfully shortening long path strings.

Everything runs through your browser's own XML parser and serializer, the same engine that parses any SVG on the web, so the optimized output is structurally valid the moment it's produced.

What's deliberately left alone

This tool sticks to transformations that can't change how the SVG looks: stripping non-rendering metadata, trimming whitespace, and rounding numeric precision by a controlled, small amount. It doesn't attempt to merge overlapping paths, simplify geometry, convert shapes to more compact path equivalents, or restructure the document — the kind of deeper, more aggressive optimizations a full build-pipeline tool like SVGO can do with its complete plugin set. That's a deliberate scope limit: those transformations occasionally introduce a subtle visual difference that's easy to miss in a diff and only noticed later, and this tool is built for a quick, safe pass you can trust without checking every pixel afterward.

Common use cases

Frontend developers use it to clean up an icon before inlining it directly in HTML, JSX, or a CSS background-image, where every byte of the SVG ships as part of the page rather than a cached external file. Designers handing off assets use it to strip identifying editor metadata before sending a file to a client or publishing it publicly. It's also a quick way to sanity-check an SVG that looks suspiciously large for how simple the artwork is — often the bloat turns out to be exactly the kind of editor cruft this tool targets, rather than genuinely complex geometry.

Reading the before-and-after comparison

The preview renders both the original and optimized SVG through an <img> tag rather than injecting the markup directly into the page — a safer way to preview untrusted or unfamiliar SVG content, since an image element won't execute any embedded script or event handler even if one happens to be present in the source file. The size figures shown alongside each preview reflect the actual byte size of the markup, calculated the same way a server would measure the file, so the percentage reduction you see is the real difference in what you'd be shipping or storing.

How to use SVG Optimizer & Minifier

  1. 1Paste raw SVG markup exported from your design tool.
  2. 2Choose which cleanup options to apply — comments, editor metadata, empty groups, and numeric precision.
  3. 3Compare the before-and-after preview and file size.
  4. 4Copy or download the optimized SVG.

Frequently asked questions

Will optimizing change how my SVG looks?

No — by default this tool only removes non-rendering metadata, comments, and excess whitespace, and rounds numeric precision by a small, configurable amount that's visually indistinguishable from the original in virtually every case.

Is my SVG uploaded anywhere?

No — parsing and optimization happen entirely in your browser using the standard DOM XML parser. Nothing you paste is sent to a server.

Does this do everything a tool like SVGO does?

No — this tool intentionally sticks to safe, non-destructive cleanup (metadata, comments, whitespace, precision). It doesn't merge paths or simplify geometry the way a full build-pipeline optimizer's advanced plugins can.

What happens if I paste invalid or non-SVG markup?

You'll see a clear parse error instead of a silently broken result — the tool checks that the input is well-formed XML before attempting any optimization.

Can I keep the <title> and <desc> elements for accessibility?

Yes — those are preserved by default, since they're what a screen reader announces for the image. There's a separate option to strip them if you specifically don't need them, for something like a purely decorative icon.

Why round numeric precision instead of leaving coordinates exactly as exported?

Design tools often export coordinates to far more decimal places than any display can actually render differently — rounding to two or three decimal places shortens path data meaningfully without a visible change, which is why it's a standard step in most SVG optimizers.

Nonkera uses cookies for analytics and to show ads. Every tool works exactly the same either way — see our Privacy Policy for details.