XML Formatter
Pretty-print and indent XML, or minify it to a single line.
Formatted
Frequently asked questions
What does the XML formatter do?
It pretty-prints XML with proper indentation to make it readable, or minifies it to remove whitespace. It also checks that the document is well-formed.
What does well-formed XML mean?
Well-formed XML follows the basic syntax rules, such as every tag being properly closed and nested and having a single root element. The tool flags input that breaks these rules.
What is the difference between well-formed and valid XML?
Well-formed means the syntax is correct, while valid additionally means the document conforms to a schema or DTD. This tool checks well-formedness, not schema validity.
Can it minify XML as well as format it?
Yes. It works in both directions, so you can expand XML for reading or strip whitespace to shrink it for transfer. The content stays the same either way.
Is my XML uploaded?
No. Formatting, minifying and the well-formedness check all run in your browser, so your XML is never sent anywhere. It stays on your device.
What happens if my XML has an error?
If the document is not well-formed, for example with an unclosed tag, the tool reports the problem instead of formatting it. Fixing the markup lets it format correctly.
Does formatting change the meaning of my XML?
Pretty-printing adds only insignificant whitespace between elements, so the data is unchanged, though whitespace inside text content is preserved. Minifying removes only that insignificant whitespace.