Skip to content
nah

SVG Optimizer

Strip editor metadata, remove comments, collapse whitespace, and round coordinates to shrink SVG file size.

100% in your browser — files never leave your device

...or paste markup below.

Input SVG
Optimized

Why SVGs exported from design tools are bloated

Illustrator, Inkscape, Figma, and Sketch all embed tool-specific metadata in SVG exports. Inkscape adds a full namespace of editor state — layer visibility, guides, version numbers, object IDs. Illustrator embeds licensing, creation software, and embedded font metadata. None of this affects how the SVG renders, but it can double or triple the file size.

Beyond editor data, generated SVGs frequently contain excessive decimal precision in path coordinates. A path point might be encoded as "123.456789012" when "123.46" produces visually identical results. The coordinate-rounding pass replaces each floating-point value with a shorter representation, which cuts significantly on icon files with hundreds of path commands.

This tool handles the safe optimization passes: metadata removal, comment stripping, whitespace collapsing, and coordinate rounding. It does not restructure paths or merge shapes — operations that can subtly alter rendering in edge cases. The result is a smaller file with identical visual output. Everything runs as a JavaScript DOM parse in your browser tab.

Frequently asked questions

What does this tool actually remove from SVG files?

You can toggle each pass individually: editor data (Inkscape, Illustrator, and similar tool namespaces), metadata and description elements, XML comments, whitespace between elements, and the title element. The coordinate-rounding pass reduces numeric precision of path coordinates to a configurable number of decimal places, which often accounts for the largest size reduction.

Will optimization break my SVG?

The passes available here are the safe ones: they remove non-rendering metadata and reduce numeric precision. They do not restructure paths, merge shapes, or alter visual output. Removing the title element affects accessibility (screen readers use it), which is why it is opt-in and labeled accordingly.

How much smaller will my SVG get?

Results vary widely by source. Icon SVGs exported from Figma or Illustrator commonly carry 30-60% overhead in editor namespaces and whitespace. Complex illustrations with many path coordinates see large gains from coordinate rounding. Simple hand-written SVGs may see minimal reduction since they already lack editor bloat.

Can I paste SVG markup directly instead of uploading a file?

Yes. The input textarea accepts pasted markup directly. Optimization runs live as you type or paste — the output updates immediately without any button press.

Is there a file size limit?

No. Optimization runs synchronously in JavaScript on the DOM parser, so it is bounded by your browser's tab memory rather than any server limit. Very large SVGs (multi-MB complex illustrations) may take a moment but will complete without an upload.

Related tools