XML Formatter

Validate and indent XML element-only sections in your browser.

Your input is processed in this browser and is not uploaded.

XML Formatter

Make nested XML elements easier to inspect without deliberately inserting indentation into mixed text. The browser checks well-formedness before serialization.

How to use it

  1. Paste one well-formed XML document.
  2. Select Run tool.
  3. Review the output, especially namespaces and text between child elements.

Worked example

<root><item id="1"/><item id="2"/></root> becomes a root with its items on separate indented lines. Mixed content such as <p>Hello <b>world</b>!</p> remains inline to avoid adding spaces inside the sentence.

Limits and troubleshooting

DTD and entity declarations are rejected. Mixed text and xml:space="preserve" sections remain inline. Serialization may normalize empty elements, namespace declarations or entity representations; this is not canonical XML or a byte-preserving editor. XML Schema and application constraints are not checked. Limit: 200,000 input characters.

Frequently asked questions

Why was a section left on one line?

Indentation is skipped when meaningful text mixes with child elements or xml:space requests preservation.

Does formatting prove the document meets its schema?

No. It establishes only that the browser parsed a well-formed document under these restrictions.