XML Validator
Validate XML online and check that it is well-formed. Syntax errors are reported with their exact line and column, so broken tags are easy to find.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the XML Validator
The XML Validator checks that a document is well-formed (properly nested and closed tags, quoted attributes, a single root) and shows the exact location of the first syntax error. Use it as an XML syntax checker: paste the code or open an XML file to check it before it reaches a parser.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the XML Validator
- Paste XML or open a file.
- Read the result or the error with its line and column.
- Fix the problem and validate again.
Example
Input
<order id="1042">
<customer>Ada Lovelace</customer>
<items>
<item sku="A-1">Notebook</item>
</itemz>
</order>Result
Error: Line 5, column 10: Unexpected closing tag: itemz != items
The first problem is reported with its line and column: here the closing </itemz> does not match the open <items>.
Common mistakes
- Unescaped special characters. Inside text and attribute values, & must be written as & and < as <. A bare ampersand in a URL query string is the most common cause of "not well-formed".
- More than one root element. A document must have exactly one top-level element. Two sibling elements at the top, for example from concatenated files, are an error; wrap them in a parent element.
- Expecting schema validation. Well-formed XML can still break a consumer that expects certain elements. This tool checks syntax, not a DTD or XSD schema.
Works well with the XML Validator
- XML Formatter: indent the document once it is valid.
- XML to JSON: convert valid XML to JSON.
- HTML Entity Encode / Decode: escape &, < and > in text you paste into XML.
Frequently asked questions
What is the difference between well-formed and valid XML?
Well-formed means the syntax is correct. Valid means it also matches a schema (DTD or XSD). This tool checks well-formedness.
Does it check namespaces?
Namespace prefixes must be declared to be well-formed, so undeclared prefixes are reported.
Why is only the first error shown?
XML parsers stop at the first syntax error, because everything after it may be read differently. Fix it and validate again to find the next one.
Is my XML uploaded?
No. It is parsed by your browser’s XML parser and never leaves your device.
Related tools
JSON Validator
Validate JSON online and find syntax errors such as trailing commas or single quotes by exact line and column. Valid documents get a structure summary.
JSON Schema Validator
Validate JSON against a JSON Schema online. Every error shows the failing path, line and rule; drafts 2020-12, 2019-09, 7 and 4 are supported.
YAML Validator
Validate YAML syntax online, find errors by line, and see the parsed result as JSON. Check Kubernetes, Docker Compose and CI files before you deploy.
Regex Tester
Test JavaScript regular expressions online with live match highlighting, capture groups and flags. Debug a pattern against your own text, right in your browser.
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.
HTML Formatter
Format and beautify messy or minified HTML into clean, indented markup with Prettier, including embedded CSS and JavaScript. Runs locally in your browser.