Skip to content
Calixo

XML Formatter

Re-indent XML into a readable, nested format.

Inputs

Saved Scenarios

— select 2+ to compare

Formatted XML

<root> <item id="1"> <name>Test</name> <value>42</value> </item> </root>

Spark says

Formula

Depth+=1 on each opening tag, 1 on each closing tagDepth += 1\ on\ each\ opening\ tag,\ -1\ on\ each\ closing\ tag
Depth
— Current indentation level

What is the XML Formatter?

This tool re-indents XML by tracking opening and closing tags, adding line breaks and indentation to reveal the document's nesting structure — useful for reading minified or single-line XML.

How to use it

  1. 1 Paste XML into the input field.
  2. 2 The re-indented version appears below as you type.

Worked examples

Limitations

  • This is a lightweight, tag-matching formatter, not a full XML parser or validator — it doesn't check for well-formedness, and unusual content (CDATA sections, or comments containing '&lt;'/'&gt;'-like text) may not indent perfectly.

Frequently asked questions

Does this validate that my XML is well-formed?

No — it only re-indents based on tag matching. For strict validation (unclosed tags, mismatched nesting, invalid characters), use a dedicated XML parser or your IDE's XML validation.