XML Validator
runs in your browserno sign-upfree
Check that XML is well-formed and see the exact line and column of any error.
Valid XML — the document is well-formed
Details
- Root element
- <catalog>
- Elements
- 10
- Attributes
- 4
- Depth
- 3
- nesting levels
- Every tag is closed and correctly nested
- Attribute values are quoted
- XML declaration found
About this tool
This XML validator checks that your XML is well-formed: every tag is closed and correctly nested, attribute values are quoted, special characters are escaped and there is exactly one root element. Any error is shown with its line and column and underlined in the editor. Valid XML gets a summary of its root element, elements, attributes and depth.
How to use
- Paste or type your XML. It is checked as you type.
- Read the status line: "Valid XML" or the error with its line and column.
- Check the Details panel for a summary of the document.
- Press Format to re-indent valid XML in place.
FAQ
Does it validate against an XSD schema or DTD?
No. It checks that the XML is well-formed — the rules every XML document must follow. Checking against a schema (which elements are allowed where) needs the schema file and a separate validator.
What are the most common XML errors?
A missing closing tag, tags closed in the wrong order, an attribute without quotes, a bare & or < in text (write & and <), more than one root element, and tag names that differ only in case — XML is case-sensitive.
Is the XML declaration required?
No. <?xml version="1.0" encoding="UTF-8"?> is optional, but recommended because it tells programs the version and character encoding. The validator mentions it when it is missing.
Is my XML uploaded?
No. Everything runs in your browser, so your XML never leaves your device.