XML Validator

Please use our XML validator to check the syntax of your XML.

Well-formed XML document

A well-formed XML document is called 'well-formed'.

The syntax rules have been described in the previous chapters:

  • An XML document must have a root element
  • XML elements must have end tags
  • XML tags are case-sensitive
  • XML elements must be correctly nested
  • XML attribute values must be quoted
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>

XML errors will terminate your program

Errors in XML documents will terminate your XML application.

The W3C XML specification states that if a program finds an error, it should stop processing the XML document. The reason is that XML software should be lightweight, fast, and have good compatibility.

HTML browsers can display HTML documents with errors (such as missing end tags).

Errors are not allowed in XML.

Check the syntax of your XML

To help you check the syntax of XML, we have created an XML validator.

Check the syntax of this correct XML:

Check the syntax of this incorrect XML:

Try to check the syntax of your own XML:

A valid XML document

A well-formed XML document is different from a valid XML document.

A "valid" XML document must be well-formed. In addition, it must conform to the document type definition.

There are two different document type definitions that can be used with XML:

  • DTD - Original Document Type Definition
  • XML Schema - An XML-based DTD Alternative

Document Type Definition (DTD) defines the rules for XML documents and the valid elements and attributes.