XML Validator
Validate XML well-formedness live — a precise line:column code-frame on the offending tag, plus a formatted copy when valid.
About this ToolHow it works, benefits & use casesTap to collapse
The XML Validator checks whether your XML is well-formed — every tag properly opened, closed, and nested — and shows you where it breaks if it is not. Paste XML and a lightweight parser tokenizes the document live, verifying that opening and closing tags match and that nothing is left dangling. Valid input gets a green "Valid XML" banner with an element count, and the tool also renders a cleanly formatted copy of your markup that you can copy or download as a .xml file. Invalid input produces a red error with the message, the line and column, and a code-frame snippet whose caret points at the offending tag — for example a mismatched or unclosed element. It handles comments, CDATA, processing instructions, and the XML declaration as it parses. This is a well-formedness check (not DTD or schema validation), it runs entirely in your browser, and it is free.
How to Use
- 1Paste your XML into the input panel, or click "Load example" to load a sample catalog document.
- 2Validation runs live as you type; click "Validate XML" to confirm.
- 3On success, read the "Valid XML" banner showing it is well-formed plus the element count.
- 4On failure, use the code-frame error with its line:column and caret to locate the mismatched or unclosed tag.
- 5When valid, copy or download the auto-formatted XML from the output panel as a .xml file.
Key Benefits
- Verifies well-formedness: matched, properly nested, fully closed tags
- Precise line:column code-frame and caret on the offending tag
- Element count reported for valid documents
- Renders a formatted copy of valid XML you can copy or download
- Recognizes comments, CDATA, processing instructions, and the declaration
- Live validation updates as you type
- Runs entirely in the browser — XML is never uploaded
Common Use Cases
- Confirming an RSS feed, sitemap, or SVG file is well-formed before publishing
- Tracking down a mismatched or unclosed tag in a broken document
- Validating a hand-edited config or SOAP payload during integration work
- Getting a formatted copy of XML in the same step as validating it
- Checking that generated XML output is structurally sound
0 characters · live
Paste XML above to validate it live.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Code Block FormatterFormat code blocks for Markdown
- GraphQL Schema ValidatorValidate GraphQL schema definitions
- Sitemap Priority CalculatorPaste a list of URLs and get a complete XML sitemap with priorities from a transparent, tunable model — each URL auto-classified by type & depth, with a per-row score breakdown and priority distribution analysis
- Twitter Card ValidatorValidate Twitter Card meta tags
- XML FormatterFormat and beautify XML
- YAML ValidatorValidate YAML syntax and structure
It checks well-formedness — that the document is syntactically valid XML with every tag opened, closed, and nested correctly. It does not validate against a DTD, XSD, or other schema, so it confirms the structure parses, not that it matches a specific document model.
On invalid input it shows the error message with a line and column and a code-frame snippet: the relevant source line with a caret (^) beneath the column. It does a best-effort job of pointing the caret at the tag named in the error — for example the unexpected close or the unclosed element.

