XML Validator
Check whether XML is well-formed, with precise error messages. It runs entirely on your device — nothing is uploaded.
Example
Paste XML to check it's well-formed. Errors point at the exact problem.
How it works
The browser's XML parser reports the first well-formedness error — unclosed tags, bad nesting or invalid characters.
Good to know
The XML Validator checks whether a snippet or full document is well-formed XML — meaning it follows the basic syntax rules every XML parser depends on, such as a single root element, properly closed and correctly nested tags, quoted attribute values, and escaped special characters. It's aimed at developers, integration engineers, and anyone working with config files, RSS/Atom feeds, SVG, SOAP requests, or sitemaps who needs a quick yes/no on whether their markup will parse at all.
Reach for it when an app rejects an XML payload, an API returns a parse error, or you've hand-edited a config and want to confirm it's clean before deploying. Because it runs entirely in your browser, you can paste sensitive or proprietary XML without it ever being uploaded — useful for internal API contracts or customer data you shouldn't send to a third-party server.
To read the result: a "valid" or "well-formed" outcome means the parser walked the whole document without a structural error. An error message points to the first problem it hit — typically with a line and column — so fix that one issue and re-run, since the parser stops at the first failure and may surface a second error only after the first is resolved.
One important caveat: well-formedness is not the same as validity against a schema. This tool confirms the syntax is correct, but it does not check your XML against a DTD, XSD, or RelaxNG, so it won't tell you whether required elements are missing or values are the wrong type. A common gotcha is bare ampersands and angle brackets in text content — write &, <, and > rather than raw &, <, or >.
Frequently asked questions
Is my data uploaded anywhere?
No — everything runs in your browser. Your code never leaves your device, so it's safe for private work and runs offline once loaded.
Is this tool free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the difference between well-formed and valid XML?
Well-formed XML simply follows XML's syntax rules: one root element, properly closed and nested tags, and quoted attributes. Valid XML additionally conforms to a schema (DTD, XSD, or RelaxNG) that defines which elements, attributes, and values are allowed. This tool checks well-formedness, not schema validity.
Why does my XML say 'opening and ending tag mismatch'?
That error means a closing tag does not match the most recently opened tag, usually from a typo, a missing closing tag, or overlapping tags. XML requires strict nesting, so tags must close in the reverse order they were opened.
Can XML have more than one root element?
No. A well-formed XML document must have exactly one root (document) element that contains everything else. Two top-level elements will trigger a 'junk after document element' or extra-content error.
How do I include special characters like & and < in XML?
Replace them with entity references: use & for an ampersand, < for a less-than sign, and > for a greater-than sign. Alternatively, wrap raw text in a CDATA section so the parser treats it as literal character data.
Does XML care about uppercase and lowercase in tag names?
Yes, XML is case-sensitive. An opening tag like <Item> must be closed with </Item>, not </item>; mismatched casing is treated as a different element and will cause a parse error.
Why is my XML declaration causing an error?
The XML declaration, such as <?xml version="1.0" encoding="UTF-8"?>, must be the very first thing in the document with no spaces, blank lines, or a byte-order mark before it. Anything preceding it makes the document not well-formed.
Is an empty document considered valid XML?
No. An empty string or whitespace-only input has no root element, which is required, so a parser reports it as not well-formed. Every XML document needs at least one element.
Related tools