Pretty print or minify XML, checked by re-parsing
XML Validator
Find the unclosed tag or stray ampersand that makes a feed, sitemap or config file fail to load.
Loading tool…
How to use xml validator
Paste XML or open a file. The sample has two mistakes to find.
Read the error: line, column, the line itself and a hint.
Fix it and the check reruns as you type.
When it passes, review the counts of elements, attributes, depth and namespaces.
What this tool does
- Uses the XML parser built into your browser, the same one that loads XML files.
- Explains common errors: mismatched tags, a bare &, unquoted attributes, HTML entities such as , and text after the root.
- Reports root element, element and attribute counts, depth, namespaces, comments and CDATA.
- Notes a missing XML declaration or a declared encoding other than UTF-8.
How the result is verified
The verdict comes straight from the browser's XML parser; the summary is counted from the document it built.
Frequently asked questions
Why does fail?
XML only defines &, <, >, " and '. HTML names like must be written as numbers, such as  , unless a DTD defines them.
What is the difference between well-formed and valid?
Well-formed means the syntax is correct: tags close, attributes are quoted, there is one root. Valid also means it follows a schema. This tool checks the first.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Find JSON syntax errors with the exact line and column
Validate YAML, fix indentation and view it as JSON