XML Validator (Well-Formedness Check)

Check whether XML is well-formed: mismatched or unclosed tags, bad attributes and invalid names are reported with line and column. Runs locally in your browser.

Runs entirely in your browser. Your data is never uploaded.

Related Tools

View All

What is XML Validator?

The XML Validator tells you whether a document is well-formed XML – every tag closed and properly nested, attributes quoted, a single root element. Errors are reported with the line and column and the original line of source.

How to use XML Validator

  1. Paste your XML into the input box.
  2. Click Validate (results also update as you type).
  3. If the result is an error, go to the reported line and column and fix it.
  4. A green Well-formed XML message means the document parses correctly.

Example

Input
<a>
<b></a>
Output
Line 2, column 4 – Syntax error: Expected closing tag 'b' (opened in line 2, col 1) instead of closing tag 'a'.

When to use XML Validator

Use it when a parser complains about your XML, before importing feeds or config files, or to check generated XML. It does not validate against DTD, XSD or RelaxNG schemas and does not check namespaces semantically.

How XML Validator works

The check uses XMLValidator.validate from fast-xml-parser. It scans the document, keeps a stack of open tags and reports the first problem: a closing tag that does not match the open one, unclosed tags at the end, duplicate or malformed attributes, invalid tag names or text outside the root element. Boolean (value-less) attributes are tolerated.

Common Use Cases

  • Debugging "XML parsing error" messages from apps
  • Checking hand-edited config files (web.config, pom.xml)
  • Validating RSS/Atom feeds and sitemaps before publishing
  • Testing XML produced by your own code

Security Note

Everything runs locally in your browser; the code you paste is not uploaded.

FAQs

What is the difference between well-formed and valid XML?

Well-formed means the syntax is correct. Valid means it also follows a schema (DTD/XSD). This tool checks well-formedness only.

Why is the error message in English?

The detailed reason comes from the XML parser; the position and labels are translated.

Does it support namespaces?

Prefixed names like soap:Envelope are accepted, but namespace declarations are not cross-checked.

Explore more categories