Skip to content
T
Tools.Town
Free Online Tools for Everyone
−60%

SVG Optimizer

100% Free

Minify and clean up SVG files in your browser — strip editor cruft, comments, and whitespace without changing how the graphic looks.

Instant
Client-Side
SVG

Everything runs in your browser — your file is never uploaded.

What to remove
Before
575 B
After
314 B
Saved
45.4%
Optimised SVG

Embed This Tool

Easy to Embed

Add SVG Optimizer to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/svg-optimizer/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="SVG Optimizer">
</iframe>

Share This Tool

Share Instantly

Share SVG Optimizer with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Paste your SVG code into the box, or upload a .svg file.
  2. 2 Choose what to remove — comments, title/desc/metadata, editor data, and whitespace are all on by default.
  3. 3 Watch the before/after byte count and the percentage saved update instantly.
  4. 4 Copy the minified SVG, or download it as a fresh .svg file.

Features

  • Strips comments, <title>, <desc>, <metadata>, and the XML declaration.
  • Removes Inkscape, Sodipodi, and Adobe editor namespaces and attributes.
  • Collapses whitespace and the gaps between tags for a smaller file.
  • Live before/after byte comparison with the exact percentage saved.
  • 100% client-side — your SVG is never uploaded anywhere.

Why it Matters

Vector editors like Inkscape, Illustrator, and Figma export SVGs padded with editor metadata, XML comments, and generous indentation — none of which affects how the graphic renders, but all of which inflates the file. For icons embedded inline in HTML or shipped in a sprite, those extra bytes add up across every page load. Optimising the SVG strips the dead weight so the visible artwork stays identical while the file gets meaningfully smaller, which means faster pages and cleaner markup.

★★★★★

Use Cases

Faster Page Loads

Shrink inline icons and illustrations so they download and parse quicker.

Clean Icon Sets

Strip editor junk before adding SVGs to a sprite sheet or component library.

Inline SVG in HTML

Produce tidy, comment-free markup that's pleasant to paste straight into a page.

Private by Default

Optimise client logos and brand assets without uploading them to a third-party server.

How to use

  1. Paste your SVG markup into the box, or upload a .svg file.
  2. Pick what to remove — comments, <title>/<desc>/<metadata>, editor data, and whitespace are all enabled by default.
  3. The before/after byte count and the percentage saved update instantly as you type or toggle options.
  4. Copy the minified SVG to your clipboard, or download it as a new .svg.

What gets removed

Optimisation is deliberately conservative — it only touches things a browser ignores:

  • Comments — comment blocks left by editors or hand-authoring.
  • Metadata — the XML declaration, the DOCTYPE, metadata, title, and desc elements.
  • Editor data — Inkscape/Sodipodi/Adobe namespaced attributes and their namespace declarations.
  • Whitespace — indentation, line breaks, and the gaps between tags.

The shapes, paths, fill colours, and viewBox that make up the actual artwork are never altered, so the output renders pixel-for-pixel the same.

Why minify SVG

Editor exports are verbose. A 2 KB icon can easily be half metadata and indentation, and when you ship dozens of inline icons that overhead repeats on every page. Smaller SVGs download faster, parse faster, and produce cleaner diffs in version control. Stripping the cruft is the cheapest performance win available for vector graphics.

Private by design

The optimiser runs entirely in your browser through a pure JavaScript string transform — no upload, no server round-trip. That keeps it instant and keeps confidential logos and client artwork on your own machine.

Frequently Asked Questions

Will optimising change how my SVG looks?
No. The optimiser only removes things that never affect rendering — comments, editor metadata, the XML declaration, and redundant whitespace. The shapes, paths, colours, and viewBox are left untouched, so the visible graphic is identical.
What is 'editor data'?
Apps like Inkscape and Adobe Illustrator add their own namespaced attributes (inkscape:, sodipodi:, and similar) plus extra XML namespace declarations to remember layers and editing state. Browsers ignore them, so they can be safely stripped from a final, exported file.
Is my SVG uploaded anywhere?
No. The entire optimisation runs in your browser with a pure JavaScript transform. Your file never leaves your device, which makes it safe for confidential logos and brand assets.
Why didn't my file get much smaller?
Already-minified SVGs or ones dominated by long path data won't shrink much, because the savings come from removing comments, metadata, and whitespace rather than re-encoding the geometry. The tool never returns a file larger than the one you gave it.

Related Tools You Might Like

Browse more free tools