XML Validator Online
The XML validator confirms that a document is well-formed and, when it is not, reports the parser error with its position. It also summarises the document: root element, element count and maximum nesting depth.
Your result will appear here.
Not sure where to start? Use Load example.
Results update automatically and are calculated on your device. Nothing you type is sent to a server.
Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.
How to use the XML Validator
- Paste the XML document you want to check.
- A valid document returns a structure summary; an invalid one returns the parser error and its position.
- Fix the reported problem and validate again.
Example
<a><b></a>
Not well-formed Mismatched tag: expected </b> but found </a>.
Common XML syntax errors and how to fix them
Nearly every well-formedness error is one of these. The validator reports the first one it meets, with its position.
| Example | Problem | Fix |
|---|---|---|
| <title>Hello | Unclosed tag | Close every element, <title>Hello</title>, or self-close an empty one as <br/> |
| <b><i>x</b></i> | Tags closed in the wrong order | Close elements in the reverse order they were opened |
| Fish & Chips | Unescaped ampersand | Write &, or wrap the text in a CDATA section |
| a < b | Unescaped less-than sign in text | Write < |
| <item id=5> | Unquoted attribute value | Quote every attribute value: id="5" |
| <a x="1" x="2"> | Duplicate attribute | Each attribute name may appear once per element |
| <a/><b/> | More than one root element | Wrap everything in a single root element |
| <Item></item> | Tag names that differ in case | Names are case-sensitive, so match them exactly |
| | An HTML entity XML does not define | XML has only & < > " ' — use   instead |
| <1st> | Name starting with a digit | Element names must start with a letter or underscore |
| ␣<?xml …?> | Something before the XML declaration | The declaration must be the very first thing in the file — no space or blank line before it |
Common use cases
- Finding the unclosed tag in a document a parser rejected.
- Checking a generated feed before publishing it.
- Confirming an SVG or configuration file is well-formed after editing.
- Checking a sitemap.xml or RSS feed before submitting it, since a feed that is not well-formed is rejected outright.
Limitations and things to watch for
- This checks well-formedness only — that tags are balanced, attributes are quoted and the document has a single root. It does not validate against a DTD, XSD or RelaxNG schema.
- Browser parsers report the first error and stop, so fixing one problem may reveal another.