XML Formatter
Pretty-print, minify and check well-formedness of XML documents.
✓ Well-formed XML (9 elements)
Your input is processed locally in this browser tab.
How to use XML Formatter
Choose Format (default), Minify, or Validate mode and pick 2-space, 4-space, or Tab indentation.
Paste XML markup to format while keeping inline leaf nodes concise and comments/CDATA intact.
Copy or download the formatted .xml document.
Frequently asked questions
Does XML Formatter keep CDATA, XML declarations, and comments?
Yes. <?xml …?>, comments, DOCTYPE declarations, and <![CDATA[…]]> sections remain preserved.
Does it validate DTD or XSD schemas?
It performs strict XML 1.0 syntax & tag-matching well-formedness checks locally without fetching external DTD schemas.