About the XML Formatter
The XML Formatter validates input with DOMParser and then applies indentation between tags while preserving text nodes. Parser errors are surfaced before any formatted output is offered.
How to use the XML Formatter
- Paste a complete XML document or element.
- Choose indentation width.
- Format and fix any well-formedness error reported.
Practical tips
- Escape literal ampersands in text as &.
- Mixed-content XML may intentionally combine text and child tags, so inspect formatting carefully.