XML Formatter

Re-indent XML with consistent spacing and readable nesting, keeping the declaration, DOCTYPE, attribute order, and text content exactly as they were.

An XML formatter re-indents a document so each element sits on its own line at a depth that matches its nesting. Nothing in the document changes except whitespace between elements.

Output

                

Paste or type something above.

Questions about xml formatter

Is the XML changed in any way?
Only whitespace between elements. Attribute order, text content, entities, and the declaration stay exactly as they were.
Why did formatting stop with an error?
The document is not well-formed XML. XML Validator reports the parser message with the position.
What does collapsing empty elements do?
A childless element with no attributes is written as a self-closing tag instead of an open and close pair.