Skip to main content
Image / SVG Developer Tools

SVG Formatter

Paste SVG markup and get it cleanly re-indented, with malformed XML clearly reported.

Paste your SVG markup below - this tool parses it as XML and re-outputs it with consistent, readable indentation.

For reducing file size instead of readability, see the SVG Minifier or SVG Optimizer.

What Does This Tool Do?

It parses SVG as XML and re-serializes it with consistent indentation - useful for SVG that's been minified, exported from design tools with inconsistent formatting, or edited by hand until it's hard to read.

Why Use This Tool?

SVG minified by an export tool or squashed onto one line is hard to review or hand-edit - reformatting it makes the actual structure (groups, paths, attributes) visible again.

How to Use It

  1. Paste your SVG markup.
  2. Click Format.
  3. Copy the cleanly indented result.

Limitations

This parses your input as XML - if it isn't valid XML, the error is reported clearly rather than guessing at a fix, since your original markup should never be silently altered into something different.

Frequently Asked Questions

SVG exported from design tools is often on one long line. Indenting it makes it easy to find and edit paths, colours and attributes by hand.

SVG is XML, so every tag must be closed and properly nested and attribute values must be quoted. The formatter points out where the markup breaks those rules.

No. Only whitespace between tags changes, so the image renders the same.
Share this tool: