XML Formatter
Pretty-print XML with clean indentation: elements nested by depth, text content kept with its element, the XML declaration, comments and CDATA sections all handled properly.
- 100% Free
- No Registration
- Works in Your Browser
This tool's workspace loads here.
How to Use
- Paste your XML into the input box.
- Choose an indent size.
- Click Format XML.
- Copy the formatted result.
About This Tool
Pretty-print XML with clean indentation: elements nested by depth, text content kept with its element, the XML declaration, comments and CDATA sections all handled properly. Turn a one-line feed or config file into something a human can actually read.
Frequently Asked Questions
Does formatting change the XML data?
No. Only whitespace between elements changes; element text is preserved. Note that whitespace inside mixed content can be significant in some XML vocabularies — check documents like that after formatting.
Is my XML uploaded?
No. Formatting happens in your browser.
Can it format invalid XML?
It will lay out what it can tokenise, but for a correctness check use the XML Validator on this site.