SVG Minifier

Paste your SVG markup below and get an optimized version instantly. Metadata, comments, editor noise, and redundant attributes are stripped client-side — your code never leaves your browser.

Remove comments
Remove metadata
Remove editor attributes
Collapse whitespace
Shorten colors
Input · SVG
Output · Minified
❤️ Support CodeConverter.net and donate ❤️

Why minify SVG?

What does SVG minification do?

SVG files exported from vector editors like Inkscape, Adobe Illustrator, or Figma are packed with human-readable formatting, editor-specific metadata, XML namespaces, comments, and redundant attributes that have absolutely no effect on how the graphic looks in a browser. An SVG minifier strips all of this noise while keeping every curve, path, and color intact — the visual result is pixel-perfect identical to the original.

Savings are dramatic: a simple icon exported from Inkscape might weigh 4 KB before minification and just 800 bytes after — an 80% reduction. For icon-heavy UIs, inline SVG used in CSS backgrounds, or image-heavy landing pages, minified SVGs can measurably improve Largest Contentful Paint (LCP), reduce bandwidth, and speed up initial page render. Unlike raster formats, an SVG never loses quality when compressed this way.

What gets removed
  • XML comments and processing instructions
  • <metadata>, <title>, and <desc> blocks
  • Inkscape, Illustrator, and Sketch editor namespaces
  • Unnecessary whitespace and newlines between tags
100% private & client-side
  • All processing runs entirely in your browser
  • Your SVG markup is never sent to any server
  • Works with proprietary design assets safely
  • Available offline after first page load
How to use this tool
  • Paste SVG markup or click Upload to load a file
  • Toggle options to control what gets removed
  • Click Minify SVG — results appear instantly
  • Copy to clipboard or download as .min.svg
SVG vs. raster compression
  • SVG minification is lossless — no visual degradation ever
  • SVGs scale to any resolution without quality loss
  • Minified SVGs are also CSS/JS animatable
  • Ideal for logos, icons, and UI illustrations
Performance impact
  • Typical reduction of 40–80% in file size
  • Fewer bytes for the browser to parse and render
  • Pairs well with gzip/Brotli server compression
  • Positive impact on Core Web Vitals & LCP scores
Inline vs. external SVG
  • Inline SVG — best for icons that need CSS styling or animation
  • External SVG — better for reuse and browser caching
  • Both benefit from minification before deployment
  • Minify once — use in <img>, CSS, or inline freely

Should I minify SVGs in my build pipeline?

Yes — if you're shipping SVGs to production, automating minification in your build process (via tools like svgo in a webpack, Vite, or Rollup pipeline) ensures every SVG is always optimized without manual steps. For a quick one-off job, pasting directly into this tool and downloading the result is the fastest path. Both approaches use the same underlying optimization strategies and deliver the same quality output.

Keep an unminified copy of your SVG in version control as your source of truth. Check in the minified version as a build artifact, never the other way around. This lets designers update the source SVG in their editor and re-run minification without having to decode a compressed file to make changes.