Input XML

Validation Result

XML Validation Examples

Valid XML must be well-formed: every tag must be closed, attributes quoted, and entities escaped. Telecom-themed examples:

Valid XML – subscriber record

Valid XML

Invalid XML – unclosed tag

The <status> tag is missing its closing >.

Invalid XML

Paste either example into the editor above and click Validate to see the result. Use Sample to load more subscriber data.

What Is an XML Validator?

XML (Extensible Markup Language) is used for config files, SOAP APIs, RSS feeds, and document formats like Office Open XML. Unlike JSON, XML is strict about structure: every opening tag must have a matching closing tag, attributes must be quoted, and entities must be properly declared. The W3C XML specification defines these rules. A single missing bracket or unquoted attribute can break parsing in browsers, libraries, or downstream systems.

An XML validator checks whether your document is well-formed. It parses your XML and reports any syntax errors with line and column numbers. This tool uses the browser's built-in DOMParser to validate. Validation runs entirely in your browser. Nothing is sent to a server, so it's safe to use with production data or sensitive configuration.

How to Use This Tool

1

Paste or Upload XML

Copy your XML and paste it into the left editor. You can also click Upload to load a .xml file from your computer. The Sample button loads example data if you want to test things out.

2

Check the Validation Result

The right panel shows VALID or INVALID. If invalid, it lists errors with line and column numbers so you can pinpoint the problem. Common issues include unclosed tags, unquoted attributes, invalid characters, malformed entities, or mismatched opening and closing tags.

3

Fix and Revalidate

Fix errors in the input and revalidate. For formatting and indentation, use the XML Beautifier or XML Formatter. If you need to convert to JSON, use XML to JSON.

When XML Validation Helps

Most developers need validation when working with SOAP or REST APIs that return XML. You paste the response here to see if it's well-formed before writing parsing logic. For extracting specific values from large XML documents, the XPath tool works well alongside this.

Config files like pom.xml, web.config, or AndroidManifest.xml often have nested structures. A small typo can break the build. Running them through here catches syntax errors before deployment.

RSS and Atom feeds are XML. If your feed validator fails or a reader can't parse your feed, this tool helps you find the exact error. For schema validation (XSD), you'll need a dedicated schema validator—this tool checks well-formedness only.

Frequently Asked Questions

What makes XML invalid?

Unclosed tags, unquoted attributes, invalid characters (e.g. unescaped < or &), malformed entities, mismatched tags, or duplicate attributes. The validator pinpoints the issue with line and column numbers.

Does this validate against XSD?

This tool checks well-formedness only—whether the XML is syntactically correct. For schema validation (XSD), which checks structure and data types against a schema definition, use a dedicated schema validator. The XML Schema Generator can create schemas from sample XML.

Is my data sent anywhere?

No. Validation runs entirely in your browser using JavaScript. No data is sent to any server. You can confirm this by opening your browser's Network tab while using the tool.

What about XML namespaces?

Namespaces are supported. The validator checks that the XML is well-formed, including namespace declarations. For complex namespace validation, a dedicated schema validator may be needed.

Related Tools

W3C XML spec. MDN DOMParser. W3C XML Schema. XPath 3.1. JSON spec.