Skip to main content

XML Validator

Check whether pasted XML is well-formed — matching open/close tags (case-sensitive), a single root element, correctly quoted attribute syntax, no duplicate attributes, and properly escaped special characters — with the exact line and column of every problem. Runs entirely in your browser.

Input

Output

Summary

Result
MetricValue
No data yet

Issues

Result
LineColumnMessage
No data yet
Was this helpful?

Guides

Paste any XML document and instantly check whether it is well-formed — the syntactic rules every XML parser enforces before it will read your data. The validator points to the exact line and column of each problem it finds, so you can fix broken feeds, config files, sitemaps, SVGs, and API payloads without hunting through the markup by hand.

What "well-formed" means

Well-formedness is stricter than HTML. XML has no forgiving browser to guess what you meant, so a single stray character stops the whole document from parsing. This tool checks the same rules a real parser applies:

  • Matching tags. Every opening tag needs a matching closing tag, and tag names are case-sensitive<Note> and </note> do not match.
  • Proper nesting. Tags must close in the reverse order they opened. <a><b></a></b> is invalid.
  • A single root element. The document must have exactly one top-level element wrapping everything else.
  • Quoted attributes. Every attribute needs a value in single or double quotes: name="value". Unquoted or bare attributes are rejected.
  • No duplicate attributes on the same element.
  • Escaped special characters. Literal & and < are not allowed in text or attribute values — use &amp;, &lt;, or a numeric character reference like &#169;.
  • A valid XML declaration if one is present — it must sit at the very start of the document and include a version.

Comments, CDATA sections, processing instructions, and DOCTYPE declarations are all recognized and skipped correctly.

How to use it

  1. Paste or type your XML into the input box (or click Try an example to load a sample document).
  2. The result updates automatically as you edit — no button to press.
  3. Read the Summary for a quick verdict (well-formed or not, and how many errors), then the Issues table for each problem's line, column, and a plain-English description.
  4. Fix the first reported error and re-check — because parsers stop at the first fatal problem, resolving the earliest issue often clears several that followed it.

You can copy or download the issue list as a CSV to share with your team or attach to a bug report.

Privacy

Validation runs entirely in your browser. Your XML is never uploaded to a server, which makes this safe to use on private configuration files, API responses, and other sensitive documents.

Does this validate against a schema or DTD?

No. This tool checks well-formedness — the syntax rules of XML itself. It does not validate against an XSD schema, DTD, or RELAX NG grammar, so it won't tell you whether a given element is allowed in a particular position, only whether the markup is structurally correct.

Why does it report several errors from one mistake?

A single unclosed or mismatched tag can throw off the parser's view of everything that follows it. Fix the earliest error listed and re-validate — the later ones frequently disappear on their own.

xmlvalidatorlinterwell-formedmarkupsyntax

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.