SVG Optimizer

Clean your SVG files — remove editor junk, comments, metadata and unused attributes. 100% local.

Drop an SVG file or click to browse

Or paste your SVG code below

Input SVG
Optimized SVG

What gets removed

1
XML declaration & DOCTYPE<?xml version="1.0"?> and <!DOCTYPE> are unnecessary in HTML contexts.
2
Comments<!-- ... --> blocks added by editors like Figma, Illustrator or Inkscape.
3
Editor metadata<metadata>, <title>, <desc>, Inkscape/Sodipodi/Sketch namespaces and attributes.
4
Empty groups<g></g> elements that serve no purpose but increase file size.
5
Whitespace — Collapses multiple spaces and newlines into single spaces, reducing size significantly.

How it works

1
Paste or drop your SVG
Drop an .svg file or paste raw SVG markup directly into the input field.
2
Optimize
Click Optimize. The tool strips comments, whitespace, redundant attributes, default values and unnecessary elements using a pure JavaScript optimizer — no server needed.
3
Review savings
Check the before/after size comparison (in bytes and percentage). A live preview shows the visual result is unchanged.
4
Copy or download
Click Copy to copy the optimized SVG to your clipboard, or Download to save it as a .svg file ready for production.

Frequently Asked Questions

Is the SVG Optimizer free?

Yes, completely free. No account, no file size limit.

Is my SVG file sent to a server?

No. Optimization runs entirely in your browser using a JavaScript-based optimizer — your file never leaves your device.

What does it optimize?

Removes comments, whitespace, redundant attributes, default values, empty groups and unnecessary metadata while preserving the visual output.

Will the optimized SVG look different?

No. The optimizer is non-destructive for visual properties. Differences are limited to code structure and file size.