What is XML Formatter?
Paste XML to pretty-print it with your chosen indentation, minify it onto a single line, or validate it. The tree view collapses elements so large documents stay readable, and comments, CDATA sections and processing instructions are shown as they are.
Syntax errors are reported with the line and column, and the formatted output can be copied or downloaded as a .xml file.
Frequently asked questions
Does formatting change my document?
Only insignificant whitespace between tags is normalized — element order, attributes, text content, CDATA and comments are preserved.
Why is my XML rejected?
XML is strict: every tag must be closed and properly nested, and there must be exactly one root element. The error message points at the first offending line and column.