📄 XML Validation Tool
Check whether XML text is well formed and optionally format it.
- Paste XML directly into the text box; there is no file upload.
- Press Validate to check the current text without reformatting it.
- Press Format to rewrite parseable XML in the input box and check it again.
- Empty input prompts for XML; formatting uses two spaces for nested elements when appropriate.
- A valid message means the XML parses as a document, not that it follows a particular data schema.
- Mixed text around nested elements is preserved instead of being split onto new lines.
- Invalid XML can show a browser-specific error message; an XML declaration may change after formatting.
Indent a nested XML element
- Input
- XML: <root><item>1</item></root>; action: Format
- Result
- <root>
<item>1</item>
</root>; status: ✓ Valid XML
- How to check it
- The nested item is placed on a new line with two spaces; its text remains 1.
Keep mixed text on one line
- Input
- XML: <p>Hello <b>world</b>!</p>; action: Format
- Result
- <p>Hello <b>world</b>!</p>; status: ✓ Valid XML
- How to check it
- Text before and after the child element is meaningful, so spacing stays inline.
Frequently asked questions
Does a valid result prove my XML matches an XSD?
No. Only well-formed XML structure is checked.
Why was mixed text not indented?
Changing whitespace around text could change its meaning.
Can I upload an XML file?
No. Paste its contents into the box.