XML ValidatorDeveloper Tools
Checks XML for well-formedness and explains each syntax error.
One unescaped ampersand or a tag closed in the wrong order and a feed, sitemap, or config file stops loading. Find the line and column of the first error, fix it, then format the file so the next mistake is easy to spot.
XML parsers do not guess. A browser shows a broken HTML page anyway, but an XML parser stops at the first problem and rejects the file. A sitemap with one bare & in a URL, an RSS feed with an unclosed tag, or a config file with an unquoted attribute fails completely.
The error from the program that rejected the file is often vague, and finding one character in a few thousand lines by eye is slow.
The XML Validator checks the XML 1.0 well-formedness rules as you type: one root element, matched and correctly nested tags, quoted attributes with no duplicates, escaped < and &, and names that start with a letter, an underscore, or a colon. When something is wrong it shows the line and column, the line itself with a ^ under the problem, and how to fix it. It reports only the first error, because one mistake often causes others further down.
Once the file passes, the XML Formatter indents it so each element sits on its own line, or minifies it to one line. It keeps comments, CDATA, and the XML declaration exactly as they are, and it refuses input that is not well-formed. Both run in your browser, on files up to 5 MB.
&, close tags in the reverse order you opened them, and quote every attribute value.<br> is not XML and is rejected.Paste it into the XML Validator. It checks the XML 1.0 rules and points to the first error by line and column.
In XML text, & starts an entity. A bare one must be written as &.
Not quite. Well-formed means the syntax is right. Valid also means the document matches a schema such as a DTD or XSD.
Yes, for well-formedness. Open the sitemap, copy its contents, and paste them into the XML Validator.
Tools used in this guide
Checks XML for well-formedness and explains each syntax error.
Beautifies XML with clean indentation or minifies it to one line.