Skip to main content

XML/XSD Validator

Free XML validator: check that XML is well-formed and valid against an XSD, with a line number for each error. Runs in your browser.

XML document

Stays in your browser
<user><name>Ada</name><email>ada@example.com</email></user>

Optional XSD schema

Stays in your browser
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="user"><xs:complexType><xs:sequence><xs:element name="name"/><xs:element name="email"/></xs:sequence></xs:complexType></xs:element></xs:schema>

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Online XML and XSD Validator

Check XML structure, optionally compare required elements against an XSD, and receive clear client-side validation feedback. Use this XML validator to check a document against an XSD and read each error with its line number. It gives integration developers a quick XML schema checker for feeds, SOAP payloads, and configuration documents before deployment.

What this validator checks and who uses it

XML well-formedness checks syntax and nesting — balanced tags, valid attributes, one root element. Adding an XSD goes further by comparing the document against a schema's required elements. Two concrete uses: an integration developer confirming a SOAP or feed response is well-formed before parsing it further, and a developer double-checking that a hand-edited config or data file still contains every element a downstream system expects.

Worked example

With the default XSD requiring <name> and <email>, validating <user><name>Ada</name></user> (email removed) reports two lines: XML is well-formed. and Missing required element: <email>. The XML itself is syntactically fine — it's only the schema comparison that catches the missing field.

Common mistakes and edge cases

  • The XSD check only confirms an element with the right tag name exists somewhere in the document (via getElementsByTagName) — it does not check element order, nesting depth, or which parent it's under. Reordered or misnested elements with correct tag names still pass.
  • There's no type checking — an <age> element containing the text "not a number" satisfies a required-element check just as well as one containing 30.
  • Only elements without minOccurs="0" are treated as required; complex type restrictions, imports, and custom validators in the XSD are not evaluated at all.

Frequently asked questions

What does the XML check validate?
It checks that the XML is well-formed: tags are balanced and nested, attributes are valid, and there is one root element. When an XSD is supplied, the tool also checks declared required elements in its supported subset.
Is full XSD validation supported?
This client-only tool supports required xs:element declarations and reports missing elements. It does not implement every XSD feature such as complex type restrictions, imports, or custom validators.
Are XML documents uploaded?
No. DOMParser validates both XML and XSD locally. Nothing is transmitted or stored.
Does the XSD check enforce element order or nesting position?
No. It checks that an element with each required tag name exists anywhere in the document, using getElementsByTagName — not that it appears in the sequence, depth, or parent the schema implies. Reordered or misnested elements with the right tag names still pass.
Why is valid-looking XML rejected by an XSD?
Being well-formed only means the tags are balanced and quoted correctly. A schema adds rules about which elements must appear, in what order, with what types and how many times. An XML file can pass the first check and still fail the second because one element is missing, spelled differently or placed after another one it should come before.

Related tools

More Formatters & Parsers

View all Formatters & Parsers tools →