XML Validator

Runs in browser Formatting

Validate XML syntax (matching tags, attributes, entities, encoding declaration) in your browser and see a structural summary of elements and namespaces.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use XML Validator

  1. Paste the XML document to check.
  2. Read the result panel: "Well-formed" with a structural summary, or the error with its exact position.
  3. Use the excerpt to locate the problem, fix it and re-validate (the check re-runs live).

XML Validator features

  • Checks well-formedness: matching tags, quoted attributes, single root, valid names
  • Reports the error with line and column plus a source excerpt
  • Structural summary: root, declaration, encoding, elements, attributes, depth
  • Lists distinct element names with counts and declared namespaces
  • Warns when no XML declaration or an unusual encoding is declared
  • Runs entirely in the browser — nothing is uploaded

XML Validator example

Detect a mismatched closing tag

Input:

<order>
  <item>Keyboard</itm>
</order>

Output:

Line 2, column 17: Expected closing tag 'item' (opened in line 2, col 3) instead of closing tag 'itm'.

Frequently asked questions about XML Validator

What does "well-formed" mean?

Well-formed XML follows the syntax rules: one root element, every tag closed and properly nested, attributes quoted, and no illegal characters. This tool checks well-formedness, not validity against a DTD or XSD schema.

Why does the error point to a different line than I expected?

Parsers report the position where the mismatch is detected, which is often the closing tag rather than the opening one. Check the tag named in the message and its nearest ancestors.

Does it validate against an XSD or DTD?

Not yet — schema validation requires the schema document. The tool does show a structural summary (elements, attributes, namespaces, depth) so you can sanity-check the document shape.

Can I validate SOAP envelopes or RSS feeds?

Yes, any XML dialect works: SOAP, RSS/Atom, SVG, Android layouts, Maven POM files, and so on.

Technical notes

Well-formedness is the syntactic layer of XML. Validity (conformance to a DTD or XSD) is a separate step that requires the schema; this tool focuses on the syntax layer and structure overview.