Skip to content

SVG optimizer

Clean comments and metadata from SVG files. Preview the image and code, then download an SVG that preserves paths and IDs.

Use UTF-8 SVG up to 200,000 characters and files up to 800 KB.

Result

Paste SVG code or choose a file.

Removes comments and XML declarations. Paths, IDs and text whitespace are preserved; the file may not get smaller.

Files are processed only on this device and are never uploaded to a server. How it works

SVG code cleaned into a smaller vector file

Clean and save SVG code

Open a UTF-8 SVG file or paste its code, then select Optimize SVG. Compare original and output byte sizes, inspect the image and code, and download the SVG. The limits are 800 KB per file and 200,000 characters of code.

What gets optimized

Comments and XML declarations are removed and the browser XML serializer cleans the markup. The metadata option also removes metadata elements and Inkscape/Sodipodi editor attributes. Path coordinates, IDs, viewBox and text whitespace are preserved. Paths are not merged and coordinates are not rounded.

Supported content and review

Scripts, style elements, animation, image elements (image and feImage), external references and elements in foreign namespaces are unsupported. Use self-contained static SVG with individual style attributes or safe inline styles. Output may not be smaller than the original. Check the image at its intended size and against its intended background.

Sources

Frequently asked questions

Can I save SVGZ or PNG?

No. The result is an uncompressed SVG file. PNG conversion and gzip-compressed SVGZ are not provided.

Why are IDs not shortened?

Gradients, clipping, accessibility labels or external CSS can refer to IDs. This tool preserves IDs to avoid breaking those references.

Last updated: