XML

XML Validator

Check whether your XML is well-formed, with precise error location and document statistics.

Your XML is parsed locally in your browser. Nothing is uploaded, logged, or stored.

1
Paste your XML here to check if it is well-formed...

How to use

  1. Paste your XML into the editor.
  2. Click Validate XML.
  3. If it is well-formed you get a summary (root element, element count, depth). If not, the first parser error is shown with line and column where available.

What well-formedness means

A well-formed XML document follows the core syntax rules: exactly one root element, every opening tag is closed, tags are properly nested, attribute values are quoted, and special characters are escaped. This validator parses the document with a strict XML parser and reports the first violation it finds — the same way a browser or web service would reject it.

Note the difference between well-formedness (syntax) and validity (conformance to a DTD or XSD schema). This tool checks well-formedness, which is what catches 99% of real-world mistakes: unclosed tags, stray ampersands, mismatched nesting, and missing quotes.

Once your XML passes, tidy it with the XML Formatter or convert it with the XML to JSON Converter.

Examples

Catch unclosed tags

A missing </item> in a feed export is reported with its line and column, so you can fix it in seconds instead of scanning by eye.

Find unescaped characters

Raw & or < inside text content breaks parsers. The validator pinpoints the offending position so you can replace it with &amp; or &lt;.

Verify before sending

Paste an XML payload before POSTing it to an API to avoid 400 responses caused by malformed bodies.

Frequently Asked Questions

Is my XML uploaded anywhere?+
No. Validation happens entirely in your browser using the built-in DOMParser API. Nothing leaves your device.
Does this validate against an XSD or DTD schema?+
No. This tool checks well-formedness (syntax), not schema validity. Schema validation requires the schema file and is typically done in your application or CI pipeline.
What errors does it detect?+
Unclosed or mismatched tags, improper nesting, unquoted attributes, unescaped special characters, multiple root elements, and other XML 1.0 syntax violations.
Why do I only see the first error?+
XML parsers stop at the first fatal syntax problem, because everything after it may be misinterpreted. Fix the reported error and validate again to find the next one.
Can I validate JSON too?+
Yes — use the JSON Validator for JSON documents, with line and column error location as well.

Related Tools

Looking for something else? Browse all tools