XML Validator
Validate XML structure and syntax.
01 Overview
About XML Validator
XML Validator checks whether an XML document is well-formed: every opening tag matched by a closing tag, elements nested correctly, attribute values quoted and special characters handled properly. XML parsers are strict — unlike HTML, a single mistake makes the whole document unreadable, which is why a broken feed or rejected service request is so often malformed XML. Note the scope: this checks well-formedness (syntax), not validation against a schema or DTD. It runs entirely in your browser, so config files and payloads stay private.
02 Workflow
How to use XML Validator
- 1Paste the complete documentAdd the whole XML — a partial document, cut off at either end, will fail validation.
- 2Run the validationThe document is checked for well-formedness locally in your browser.
- 3Read the resultIf it is well-formed, XML syntax is ruled out as your problem. If not, the error points at the fault and the element involved.
- 4Fix and repeatClose the unclosed tag, quote the attribute or escape the character, then validate again until the document passes.
03 Good to know
Frequently Asked Questions
What does well-formed XML mean?
It means the document follows basic XML syntax rules: one root element, matched opening and closing tags, correctly nested elements, quoted attribute values, and properly escaped special characters.
Is well-formed the same as valid against a schema?
No. Well-formedness is about syntax only. Schema validation additionally checks that elements and values match a defined schema or DTD. This tool checks well-formedness, which is the essential first step.
What are the most common XML errors?
Unclosed tags, overlapping elements, unquoted attributes, and unescaped characters like a bare ampersand in text. The validator reports these so you can fix them one at a time.
What is the difference between well-formed and valid XML?
Well-formed means the syntax is correct: matched tags, correct nesting, quoted attributes. Valid means the document also matches a schema or DTD that defines which elements and values are allowed. Well-formedness is the essential first step; schema validity is the stricter second one.
What is a DTD or XSD schema?
It is a definition of the structure a document must follow: which elements are allowed, how they nest, and what values attributes may hold. Schema validation checks a document against that definition, while this tool checks well-formedness, which is syntax only.
Why does one XML error break the whole document?
XML parsers are strict by design: unlike HTML, where browsers guess past mistakes, a single syntax error makes the whole XML document unreadable. That is why a broken feed or a rejected service request is so often malformed XML.
How do I escape an ampersand in XML?
Write it as & instead of a bare &. The same applies to the other special characters: a less-than sign is < and a greater-than sign is >. Unescaped, they are read as markup rather than text and break the document.