XML Syntax Checker & Validator
Paste XML to check for well-formedness, find unclosed tags, missing attributes, and syntax errors
Paste your XML, hit Validate, and get the exact line and column where the syntax breaks — unclosed tags, mismatched elements, bad attributes, illegal characters. Valid markup comes back pretty-printed with color highlighting. And everything runs in your browser. Nothing gets uploaded.
How It Works
When you hit Validate, the browser's built-in DOMParser reads your XML character by character. If it hits a problem — an unclosed tag, a bad attribute, an illegal character — it stops and reports the exact position. No errors? You get a formatted, syntax-highlighted version of your XML back. The whole process happens locally in JavaScript; nothing leaves the page.
Examples
Missing Closing Tag
You forgot to close a <name> element inside a list of books.
<library>
<book>
<name>1984
</book>
</library>
Error at line 4: Opening and ending tag mismatch: name and book
Unquoted Attribute Value
An attribute value without quotes — common when copying from older documents or templates.
<user id=42>
<name>Alice</name>
</user>
Error at line 1: attributes construct error
Valid SOAP Envelope
Checking a SOAP request before sending it to a web service endpoint. This one is well-formed.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetPrice>
<Item>Widget</Item>
</GetPrice>
</soap:Body>
</soap:Envelope>
✔ XML is well-formed. Pretty-printed output with syntax highlighting displayed.
Who Uses This
Debugging SOAP requests, RSS feeds, and API payloads that refuse to parse.
Validating Maven pom.xml, Spring configs, and CI pipeline definitions before deploy.
Checking exported XML datasets from tools like Excel, SAS, or government data portals.
Learning XML syntax rules for web development or database courses — instant feedback on mistakes.
Common Mistakes
Writing & instead of & inside element text breaks the parser instantly. Same goes for < — use < if it is not a tag. This is the single most common XML error.
XML is case-sensitive. <Item> and </item> are two different tags. If you opened with uppercase, you have to close with uppercase. HTML lets you get away with this — XML does not.
Every XML document needs exactly one root element wrapping everything else. Got two sibling elements at the top level? Wrap them in a single parent like <root> or <data>.
Most parsers accept <br />, but some legacy tools choke on it. Stick to <br/> with no space for maximum compatibility. If you are getting a weird error on a self-closing tag, try removing the space first.
Technical Details
- Processing: 100% client-side — uses the browser's native DOMParser API
- Browser Support: Chrome, Firefox, Safari, Edge (all modern versions)
- Max Input Size: Limited only by browser memory — tested with files up to 5 MB
- Supports: Namespaces, CDATA, processing instructions, comments, XML declarations
- Output: Pretty-printed with indentation and syntax highlighting (tags, attributes, strings, comments)
Frequently Asked Questions
What does "well-formed XML" actually mean?
It means the XML follows basic syntax rules: every tag is closed, tags are nested correctly, attribute values are in quotes, and there is exactly one root element. Well-formed doesn't mean the data is correct or matches a schema — just that any parser can read it without choking.
What is the difference between well-formed and valid XML?
Well-formed is the minimum bar — correct syntax. Valid means the XML also matches a DTD or XSD schema that defines which elements and attributes are allowed. This tool checks well-formedness. Schema validation is a separate step that requires the actual DTD or XSD file.
Can I check XML with namespaces and CDATA sections?
Yes. The browser's DOMParser handles namespaces (xmlns declarations, prefixed elements), CDATA blocks, processing instructions, and XML declarations just fine. If your XML uses them, they will be validated and shown correctly in the formatted output.
Is my XML data safe when using this tool?
Completely. All parsing runs in your browser — your XML is never sent to a server. There are no analytics on the input, no cookies tracking content, no server logs. You can disconnect from the internet and the checker still works perfectly.
Why does my XML pass here but fail in my application?
This tool checks well-formedness, not schema validity. Your application probably expects specific elements, attributes, or data types defined by a schema (XSD/DTD). The XML can be perfectly well-formed and still not match what your app needs. Check your schema requirements separately.