To format XML, paste it into the XML Formatter, which checks that it is well-formed and re-indents it so it is easy to read. If the XML has an error, the tool reports it instead of formatting.
How to use the XML Formatter / Validator
- Paste your XML.
- Run the formatter.
- If it reports an error, fix the mismatched or unclosed tag and run it again.
- Copy the indented XML.
Worked example
<a><b>1</b><c>2</c></a> is re-indented so each element sits on its own line, making the nesting visible.
Tips and common mistakes
- Every opening tag needs a matching closing tag and elements must nest properly.
- Attribute values must be quoted.
- Well-formed only means the syntax is right; it does not check against a schema.
Frequently asked questions
What does well-formed mean?
The XML follows the basic syntax rules: one root element, matched tags and quoted attributes.
Does it validate against an XSD schema?
No. It checks well-formedness, not a specific schema.
Is it private?
Yes. Formatting happens in your browser.