XML Formatter
Pretty-print and validate XML with readable indentation.
The XML Formatter pretty-prints an XML document with readable indentation and helps you see its structure at a glance. It surfaces well-formedness problems such as mismatched tags or unescaped characters by pointing at where the document stops parsing, which is the fastest way to fix a broken feed or configuration file. The tool preserves significant whitespace inside mixed content, so re-indenting does not change how a document with element-only content is parsed. Use it when debugging an XML response, reviewing a config, or cleaning up a pasted document. XML is verbose by nature, and that verbosity is an advantage when the document is indented, because the nesting is what tells you where you are. Pretty printing places each element on its own level so the hierarchy is visible, which makes it far easier to find a specific node in a large document, to spot a sibling that ended up in the wrong parent, and to review a change in a feed or a configuration file. Well formedness checking is the other half of the job and often the more valuable one, since the error messages from XML parsers tend to be terse, naming a line and a character without explaining the cause. A formatter that stops at the exact position where parsing fails localises the problem to a mismatched closing tag, an attribute missing its quotes, or an unescaped character, and that is usually enough to find it immediately. One subtlety worth knowing is that reformatting only changes the whitespace between elements, so documents whose content is element only are unaffected, which means you can safely compare the formatted output against the original to confirm that nothing but layout moved.
Result appears here.
Frequently Asked Questions
Why does my XML refuse to format?
Usually unescaped & or < inside text, or mismatched tags. The formatter surfaces the error location so you can escape or repair it.
Does indentation change XML parsing?
Only inside mixed-content text nodes. Element-only XML is unaffected; the formatter preserves significant whitespace.
Is my XML validated?
It is formatted, not schema-validated. Well-formedness errors are caught; semantic validation still needs an XSD.