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?

You sent a SOAP request, got XML back, and your parser crashed. Or you edited a web.config and the app stopped loading. This is the developer pain of malformed XML. Unlike JSON, XML is strict: every opening tag must match a closing tag, attributes must be quoted, and entities must be properly declared. The W3C XML specification defines every rule. This validator uses the browser's DOMParser to check your XML and pinpoints errors with exact line and column numbers. Nothing is uploaded — it all runs locally.

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 well-formedness validation fail?

Unclosed tags, unquoted attributes, invalid characters (e.g. unescaped < or &), malformed entities, mismatched tags, or duplicate attributes. See the W3C well-formedness constraints for the full list. The validator pinpoints every issue with exact line and column numbers.

Does this validate XML against an XSD schema?

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

Is my XML data sent anywhere?

No. Validation runs entirely in your browser using the built-in DOMParser. No data is sent to any server. Open your browser's Network tab while using the tool to confirm.

What about XML namespaces and prefixes?

Namespaces are fully supported. The validator checks well-formedness including namespace declarations per the W3C XML Namespaces spec. For complex namespace-specific schema constraints, a dedicated schema validator may be needed.

How do I fix XML validation errors?

The error report includes line and column numbers. Common fixes: close every open tag, quote all attribute values, escape & as &amp; and < as &lt;. Use the XML Beautifier to indent first, making errors easier to spot. The MIME type spec describes XML media types.

Related Tools

For XML validation, see the W3C XML spec, MDN DOMParser, W3C XML Schema, and XPath 3.1. For JSON, see JSON spec. See also W3C XML and Postman.