Skip to content
D DocNectar

Free XML Validator and Lint Tool

Check pasted XML for well-formedness errors, with the exact line and column reported.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

XML that isn't well-formed — a missing closing tag, an unescaped ampersand, mismatched nesting — will fail to parse in almost any consumer. This tool checks well-formedness using the same libxml engine behind PHP's DOM and SimpleXML, reporting the exact line and column of the first problem found.

How it works

Paste XML and the tool attempts to parse it, collecting any libxml parser errors. If none are found, the document is well-formed; otherwise the first error's line, column, and message are reported.

  1. Enter xML.
  2. Click Calculate to see your results.

Examples

A mismatched closing tag

<root><a>1</a><b>2</a></root> fails because the second element opens as <b> but closes as </a> — the parser reports the exact line and column where the mismatch was detected.

Who should use it

  • Debugging a broken XML feed, config file, or API response.
  • Quick sanity-check before feeding XML into another system.

Industry applications

  • Web and API development
  • Data integration and ETL pipelines

Advantages

  • Reports the precise line and column of the first parser error.
  • Uses the same libxml engine PHP itself relies on for XML parsing.

Limitations

  • Only checks well-formedness, not conformance to any particular schema or DTD.

Common mistakes to avoid

  • Leaving a raw & character in text content instead of escaping it as &amp;.
  • Assuming the reported error line is exactly where the mistake was made — sometimes the true cause (like an unclosed tag) is earlier, and the parser only detects the mismatch further down.

Best practices

  • Fix the first reported error and re-check — later errors are sometimes just knock-on effects of the first one.
  • For structural (not just syntax) validation against a defined schema, follow up with the XML Schema Validator tool.

Tips

  • Pair this with the XPath Evaluator to query specific values once you've confirmed the XML is well-formed.

Frequently asked questions

Yes, with no signup and no limit on how many documents you check.
No — this tool only checks well-formedness (correct XML syntax): valid nesting, closing tags, entities, and a single root element. For real conformance against an XSD schema, use the separate XML Schema Validator tool.
Every opening tag has a matching closing tag (or is self-closed), tags are properly nested, there's exactly one root element, attribute values are quoted, and special characters like & and < are properly escaped or represent valid entities.
A common cause is an unescaped ampersand (&) in text content — XML requires it be written as &amp; — or a mismatched/unclosed tag several lines above where the parser actually reports the error.

Get new calculators and guides in your inbox

No spam — just new tools like XML Validator and Lint Tool and practical guides.

Favorites