Code Beautify / MULTIVERTO

Minify SVG

Compact whitespace between SVG elements.

Live converterYour input stays in this browser. No text is uploaded for conversion.

The file stays in your browser.
Chain tools

Apply each text tool to the previous result. Text workflows ↗

Only the recipe name and tool order are saved in this browser. Your input and results are never saved.

01 / Example

Example

Your input<svg xmlns="http://www.w3.org/2000/svg"> <circle cx="25" cy="25" r="20"/> </svg>
Result<svg xmlns="http://www.w3.org/2000/svg"><circle cx="25" cy="25" r="20"/></svg>

02 / Guide

Minify SVG — How it works

What changes in this tool

Compact whitespace between SVG elements. SVG compaction removes whitespace-only nodes between shapes and groups while leaving attribute values untouched. A smaller text file is not proof of a smaller rendered image or faster loading. Inspect text elements and references after using the compact output.

Know the format

SVG compaction keeps the underlying path geometry as written. This matters because visual optimizers make many additional decisions that require understanding the rendered image. The editor requires a simple well-formed svg root and refuses declarations, comments and CDATA. After conversion, render the file at several sizes and check any text, viewBox and references.

A dependable workflow

Begin with an SVG that already renders correctly, and save its readable source. The compacting step removes whitespace-only gaps between supported markup nodes. It does not rewrite path commands, merge shapes or optimize image geometry. That distinction matters when estimating a performance gain: fewer spaces may have only a modest effect on a drawing dominated by path data. Keep text elements and their surrounding nodes in your sample, because a graphic can contain readable words as well as shapes. Inspect the output before using it in an asset pipeline. In the live example, with line breaks shown as JSON escapes, input "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"25\" cy=\"25\" r=\"20\"/>\n</svg>" produces output "<svg xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"25\" cy=\"25\" r=\"20\"/></svg>". Compare an SVG icon containing a title and a text element before and after compaction. Review both its visible pixels and accessible name in the embedding page. A smaller XML string is not evidence that text placement, inherited styles or references to definitions survived every downstream optimizer.

Check the result

Use the compact form when embedding a simple SVG snippet in a page or comparing serialized icons. Preview the picture after conversion, including text and any URL references. Only layout whitespace between supported elements is removed; paths are not simplified and raster dimensions are unaffected. Keep the source for further manual editing. Compare the rendered image at multiple sizes and in the destination page if it inherits styles. Look for changed text spacing, misplaced shapes, missing references and differences around clipping or grouped transforms. A visually similar thumbnail may hide a broken link to a definition that appears only in another state. If the asset is hashed for caching, calculate that hash from the final compact bytes. Retain the source version for future editing, and use the compact one only after confirming that identifiers and accessible descriptions still reach the page correctly.

How this conversion transforms the input
SVG — Input
Read and transform structure
SVG — Result

Explore guides

Conversion guides

Explore guides