XML Validator

Check whether an XML document is well formed. Mismatched or unclosed tags are reported with the exact line and column, and a valid document shows its root element, depth, and total element count. Everything runs in your browser, nothing is uploaded.

XML
Ready. Press Validate.

How to use the XML Validator

  1. Paste XML into the input pane.
  2. Press Validate.
  3. Read the result, or the line and column of the first error.

Example

A valid catalog: root catalog, 8 elements, depth 3.

<catalog><book id="1"><title>JSON Basics</title><author>Ada</author><empty/><price>9.99</price></book><book id="2"><title>XML Guide</title></book></catalog>

Frequently asked questions

What does well formed mean?

The document follows XML syntax: one root element, every tag closed, attributes quoted, and no stray characters. It does not check against a schema or DTD.

Does it validate against a schema?

No. This checks syntax only. Schema validation is a separate concern and is not covered here.

Why is my document invalid?

The most common causes are a mismatched closing tag, an unclosed element, or two root elements. The error message names the line and column so you can find it.