What is an XML validator?
An XML validator checks whether a document is well-formed — syntactically correct according to the XML specification. XML powers RSS feeds, SOAP services, SVG graphics, Android layouts, Maven POM files, SOAP envelopes, and countless enterprise integration formats. Unlike JSON, XML uses opening and closing tags, attributes, and optional namespaces, which creates more ways for a document to break.
This validator parses your document in the browser and reports either a success confirmation or a failure with the parser's message and line number. That turns cryptic production errors into an actionable fix: go to line 47, close the tag, validate again.
How to use the XML validator
- Paste your XML into the text area — a config snippet, an RSS feed, an SVG fragment, or a SOAP envelope.
- Click Validate XML. Results appear above the button.
- If valid, a green banner confirms the document is well-formed XML.
- If invalid, a red banner shows the error message and line number. Fix the issue at that location and validate again.
Common XML errors
Unclosed or mismatched tags
Every <element> must have a matching </element>, or use self-closing syntax like <element />. Nesting must be correct: inner tags close before outer tags.
Illegal characters and unescaped entities
Ampersands and less-than signs inside text content must be escaped as & and <. Attribute values must be enclosed in single or double quotes.
Multiple root elements
A well-formed XML document has exactly one root element wrapping everything else. Sibling roots at the top level are not allowed unless using a multi-document format with explicit separators.
Validation vs. formatting
Validation (this tool) confirms the document parses correctly. Formatting — see the XML Formatter — rewrites well-formed XML with consistent indentation for readability. Always validate first; formatting a broken document will fail for the same reason parsing does.
For JSON-based configs, use the JSON Validator. For YAML, use the YAML Validator.
Practical tips
- Validate XML config files before deployment — a malformed file can prevent an application from starting entirely.
- When debugging RSS or Atom feeds, validate the raw XML before checking feed-specific rules.
- Use the XML Formatter after validation to make complex documents readable for code review.
- For HTML markup (which is not always well-formed XML), consider the HTML Formatter instead.