XML Formatter & Validator
Format, validate and pretty-print XML with clear error messages.
Processed on your device. Files are not uploaded
How to format XML
Paste your XML
Paste or type your XML into the box.
Format
The XML is validated and pretty-printed.
Copy the result
Copy the result, or use it straight away.
Worked example
This is what XML Formatter & Validator gives for its own sample values. Open the tool above and change anything to try your own.
XML
<library><book id="1"><title>Dune</title><author>Frank Herbert</author></book><book id="2"><title>Emma</title><author>Jane Austen</author></book></library>
Formatted
<library>
<book id="1">
<title>Dune</title>
<author>Frank Herbert</author>
</book>
<book id="2">
<title>Emma</title>
<author>Jane Austen</author>
</book>
</library>Result
- Elements
- 7
About XML Formatter & Validator
Make XML readable and check that it is well-formed. If there is a mistake, the message tells you what is wrong.
FAQs
What does well-formed mean?
Every tag is closed and properly nested.
Can I only validate it?
Use XML Validator.