dilettanteee

XML Formatter

Indent and tidy XML, catching mismatched or unclosed tags.

Indent
Input
Output

Formatted XML appears here.

About XML Formatter

The XML Formatter re-indents XML so nested elements are easy to follow, and it verifies that every tag is properly opened and closed. It is handy for reading SOAP responses, RSS feeds, sitemaps and configuration files that arrive as a single unbroken line.

How to use it

  1. Paste your XML into the input panel.
  2. Choose an indent of 2 spaces, 4 spaces or a tab.
  3. Check the status chip: it reads Well-formed when the document is valid XML and Invalid when it is not.
  4. Copy the indented result from the output panel.

Good to know

  • When a closing tag does not match its opening tag, or a tag is never closed, the message tells you which tag caused the problem.
  • The tool checks that the document is well-formed. It does not validate against a schema such as an XSD or DTD.
  • The output is meant for reading and debugging. If exact whitespace inside text content matters for your use, compare the result with your original before relying on it.

Common questions

What is the difference between well-formed and valid XML?

Well-formed means the tags are correctly nested and closed and the syntax is legal. Valid means the document also follows a specific schema. This tool checks the first, which is what most parsers require before anything else.

Does my XML get uploaded?

No. Everything is processed locally in your browser.