SVG Optimizer

Minify & clean SVG files for the web

Paste or upload an SVG to strip comments, metadata and redundant whitespace, shrink its file size and see the savings — all in your browser.

Optimized SVG
The optimized SVG will appear here.

About the svg optimizer

SVG files exported from design tools often carry comments, editor namespaces (Inkscape, Illustrator), metadata blocks and redundant default attributes that bloat the file without affecting how it renders. Removing this dead weight speeds up page loads and shrinks icons.

This optimizer strips comments, <metadata>, <title> and <desc> elements, editor namespaces and sodipodi/inkscape cruft, removes common default attributes, and collapses whitespace between tags — all without changing the visible shape.

Options

  • Remove comments — delete <!-- … --> blocks.
  • Remove metadata — drop metadata, title, desc and editor namespaces.
  • Remove default attributes — drop attributes that match the SVG default.
  • Collapse whitespace — remove indentation and inter-tag whitespace.

How to use the svg optimizer

  1. Paste or upload an SVG

    Paste SVG markup into the box, or upload an .svg file.

  2. Choose options

    Toggle which optimizations to apply — all are on by default.

  3. Read the result

    The optimized SVG and the byte savings appear instantly.

  4. Copy or download

    Copy the cleaned SVG to your clipboard or download it as a file.

Frequently asked questions

Will optimization change how my SVG looks?
No. It only removes comments, metadata, editor cruft, default attributes and whitespace — none of which affect rendering. Always preview the result for complex SVGs.
What are sodipodi and inkscape namespaces?
These are private attributes added by the Inkscape editor to preserve editing state. They are useless in production and safe to remove.
How much can I expect to save?
It depends on the source, but editor-exported SVGs commonly shrink by 30–60% after removing metadata, namespaces and whitespace.
Does this handle SVGZ (gzipped SVG)?
No. This tool works on plain SVG text. Decompress SVGZ files before pasting them.
Is my SVG sent to a server?
No. All optimization happens entirely in your browser.

I want to…

Common reasons people reach for the svg optimizer — see if it matches your task.

  • Minify an SVG file for the web
  • Strip comments and metadata from an SVG
  • Reduce the file size of an SVG icon
  • Clean up and compress SVG markup