XML Validator
This tool checks that XML is well-formed. If it is not, it shows the first problem with its line and column, and if it is, it counts elements and attributes.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use XML Validator online
- Paste the XML. Type or paste the text.
- Read the answer. See Yes or No.
- Find the problem. Look at the line, column and nearby text.
- Check again. Edit the text and the answer updates.
Why use this free XML Validator
- Line and column of the first error
- Counts of elements and attributes
- Nesting depth
- Root element named
- Size shown
- Share by link
What well-formed means
XML is well-formed when it follows the basic rules of the language: there is one root element, every opening tag has a matching closing tag in the right order, attribute values are in quotes, attribute names are not repeated on an element, and ampersands are written as entities. A parser must refuse anything else.
What the tool reports
For valid XML, it shows the root element, the number of elements and attributes, the nesting depth and the size in bytes. For invalid XML, it names the problem, such as a tag that does not match, and shows the line and column and the text around it. Fix the first error and check again.
A worked example
The document with a root element and two item elements is well-formed (Yes). Its root is root, and it has 3 elements, 2 attributes and a nesting depth of 2. If you remove the closing tag of one item, the tool points to the line where the tags stop matching.
Valid versus well-formed
A valid XML document is well-formed and also follows a schema or a DTD that sets which elements may appear. This tool checks well-formedness only. It does not read a schema, so it cannot tell if the elements are the ones your system expects. Use it as the first step before schema checks.
Common slips
Typical errors include a missing closing tag, tags closed in the wrong order, an attribute value without quotes, a bare ampersand in text and two root elements. Text copied from a document may hold curly quotes in attributes, which break XML. The XML formatter can indent the text once it is well-formed.
Using the tool
The XML Validator works again whenever the text or an option changes. Open a text file into the box, or drop one on it.
XML Validator: frequently asked questions
What is well-formed XML?
Does it test against a DTD or schema?
Does it show the line of an error?
Is a bare & allowed in text?
Can it handle large files?
Is the text I paste into the XML Validator uploaded?
Is there a way to reuse the XML Validator result?
Related searches for XML Validator
- XML Validator online
- free XML Validator
- XML Validator online free
- XML Validator for mobile
- XML Validator without sign up
- XML Validator – Text & Writing Tools
XML Validator is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.