XML Validator
Check XML is well-formed and locate errors.
Validate XML well-formedness with the browser's native parser and get the exact line and column of the first error — mismatched tags, unclosed elements, illegal characters or multiple roots. Valid XML is shown formatted. Runs fully in your browser — nothing is uploaded.
How to use XML Validator
Paste your XML
Paste your XML or upload an .xml, .svg or .rss file into this free online XML validator to check it instantly in your browser, with nothing uploaded.
Validate instantly
The XML validator parses your document with the browser's native engine and tells you immediately whether the XML is well-formed, with no sign-up needed.
Read the error
If something is wrong, you get the parser's message plus the exact line and column for mismatched tags, unclosed elements or more than one root.
Fix the issue
Jump to the reported line, correct the bad nesting, stray ampersand or unquoted attribute, then revalidate the XML to confirm it is well-formed.
Format when valid
Once your XML is well-formed, the validator also pretty-prints it with clean 2-space indentation, so you can verify and beautify the XML in one step.
Copy or download
Copy the validated, formatted XML to your clipboard or download it as a ready-to-use .xml file straight from your browser.
Frequently asked questions
What's the difference between well-formed and valid XML?
“Well-formed” means the syntax is correct: tags are closed, properly nested, quoted and have a single root. “Valid” usually adds a check against a DTD or XSD schema. This tool checks well-formedness, which the browser's built-in XML parser enforces, and is the most common thing you need to verify.
Why does an unescaped & break my XML?
In XML, & starts an entity reference (like &). A bare & that isn't part of an entity is a syntax error. Replace it with &, or wrap the text in a CDATA section. The validator points you at the exact spot.
Can I have more than one root element?
No. A well-formed XML document must have exactly one top-level (root) element. Multiple roots is one of the most common errors and will be flagged here.
Is anything sent to a server?
No. Validation uses your browser's built-in DOMParser, so the XML never leaves your device — safe for private or proprietary documents.
How do I validate XML online for free?
Paste or upload your file into this free online XML validator and it instantly checks the XML for syntax errors — no sign-up, no install, no upload. It works for any XML file, including SVG, RSS feeds, sitemaps and config files.
Why is my XML not well-formed?
The most common reasons XML isn't well-formed are mismatched or unclosed tags, missing or unescaped special characters like & and <, attribute values without quotes, or more than one root element. The validator shows the exact line and column so you can fix the error fast.
Can I check and format my XML at the same time?
Yes. When your XML is well-formed, this XML validator also pretty-prints it with clean 2-space indentation in the output pane, so you can verify and beautify your XML in one step.
Related tools — Formatters & validators
- JSON Formatter — Beautify or minify JSON with live error checking.
- JSON Validator — Validate JSON and pinpoint syntax errors.
- XML Formatter — Pretty-print or minify XML, well-formedness checked.
- YAML Formatter — Tidy YAML or convert it to JSON.
- SQL Formatter — Standardise SQL with dialect-aware formatting.
- SQL Beautifier — Turn cramped one-line SQL into readable queries.