Free online tools to generate, calculate,
convert, format, encode, and play.
 

XML Validator

Validate XML data and check well-formedness with detailed error reporting, structure analysis, and namespace detection.

Drop an .xml file here or
Valid document With namespaces Unclosed tag Mismatched tags Bad attribute

How It Works

This tool validates your XML using the browser's native DOMParser, which checks for well-formedness according to the W3C XML 1.0 specification. All processing happens entirely in your browser — no data is sent to any server.

What Gets Checked
  • Well-formed XML structure (properly opened and closed tags)
  • Matching tag names (case-sensitive)
  • Properly quoted attribute values
  • Single root element requirement
  • Correct nesting of elements
  • Valid character references and entities
XML Syntax Rules
  • Elements must have closing tags: <tag>...</tag> or self-close: <tag />
  • Tag names are case-sensitive: <Name> ≠ <name>
  • Attribute values must be quoted: id="1" or id='1'
  • Documents must have exactly one root element
  • Special characters must be escaped: &lt; &gt; &amp; &quot; &apos;
  • Comments use <!-- ... --> syntax
  • CDATA sections: <![CDATA[ ... ]]>
Common Errors
ErrorExampleFix
Unclosed tag<item>text<item>text</item>
Mismatched tags<a>text</b><a>text</a>
Unquoted attribute<item id=1><item id="1">
Unescaped &<p>A & B</p><p>A &amp; B</p>
Multiple roots<a/><b/><root><a/><b/></root>
Tip: Need to format or beautify your XML? Try the XML Formatter for pretty-printing, minification, and tree view.

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with