Input

Validation Results

Enter or paste your XML to validate

The XML Validator

A SOAP client rejects your request with nothing more useful than "parse error at line 1", or a build fails on a config file someone hand-edited and left an unclosed tag in. Finding that one tag in a few hundred lines of nested markup by eye takes longer than it should. XML Validator runs the browser's own DOMParser against your document the moment you paste it and tells you exactly which line and column parsing broke on — the same message the parser itself would give a real client, not a guess.

Well-formed XML is a short list of rules: every element closes, attribute values are quoted, there is exactly one root element, and a bare & or < inside text gets escaped as &amp; or &lt;. It sounds simple until you are staring at a 300-line WSDL file wondering which of eleven <plan> tags is the one missing its closing slash — and worth knowing up front: the parser reports where it gave up, which is often several lines past where the actual mistake is (the example below shows exactly that). For the formal rules, the W3C XML 1.0 specification is the source of truth, and MDN's XML introduction explains the concepts in friendlier terms.

How to Use XML Validator

  1. Paste or Upload Your XML – Copy your XML into the input panel, or click "Upload" to load an .xml file from your computer.
  2. Automatic Validation – The tool checks your XML the moment you type or paste. There is no button to press—results update in real time.
  3. Review the Result – The right panel shows a green "Valid XML!" message with statistics, or a red message that points to the line and column where parsing broke.
  4. Fix and Re-check – Read the error message, fix the offending tag or attribute in the input, and watch the panel turn green.
  5. Format Once Valid – When your XML is well-formed, hit "Format" to pretty-print it with clean indentation.

Pro Tip: Use the "Invalid Sample" button to see what a well-formedness error looks like, or "Sample" to load a clean XML example you can edit.

Example

A typo on line 4 — a second &lt;plan&gt; where a closing &lt;/plan&gt; belonged — but watch which line the validator actually reports.

Invalid XML → Validation error Validate
subscriber.xmlInvalid · 1 error
<subscriber>
  <subscriberId>SUB-1001</subscriberId>
  <msisdn>447700900142</msisdn>
  <plan>Unlimited 5G<plan>
  <roaming>true</roaming>
</subscriber>
Validation result1 issue found
✗ Invalid XML

Line 6, Column 14
Error: Opening and ending tag
mismatch: plan line 4 and subscriber

The typo is the second <plan> on line 4 —
it needed a slash. But the browser's parser
doesn't notice until it hits </subscriber>
on line 6, because that unclosed <plan> was
still open and swallowed everything after it.
The reported line is where the parser gave up,
not where you actually made the mistake.

Common Use Cases

Validating SOAP Requests and Responses

Many telecom and enterprise back ends still exchange SOAP, and a malformed envelope gets rejected at the door. Paste the request here before you send it and confirm it is well-formed first—that rules out the easy class of failures before you start blaming the service. For the envelope rules, the W3C SOAP specification spells out the structure.

Checking Configuration and Feed Files

Build manifests, app-server configs, RSS feeds, and SIM provisioning files are all XML, and one bad character can take a whole service down on startup. Validate the file here before you commit or deploy. If you also need to confirm a file against a public service, the W3C validator is a useful second opinion.

Learning XML Syntax

If you are getting comfortable with XML, the validator is a fast feedback loop: change a tag, see immediately whether it is still well-formed, and learn the rules by doing. Delete a closing tag on purpose and watch where the error actually points — it is rarely the line you expected, which is worth learning early. W3C's "XML in 10 points" covers the core rules in one short page.

Key Features

  • Real-Time Validation – Checks XML well-formedness as you type, with instant feedback and no button to press.
  • Clear Error Reporting – Surfaces the parser's message so you know what broke and roughly where.
  • XML Statistics – For valid XML, shows size, line count, total element count, and nesting depth.
  • Native Parser – Uses the browser's DOMParser, the same engine real applications rely on.
  • File Upload Support – Load .xml files directly instead of copy-pasting, handy for larger documents.
  • Format When Valid – Pretty-print well-formed XML with one click.
  • Sample Data – Load valid or deliberately broken XML to see how the validator behaves.

Frequently Asked Questions

Is my XML uploaded anywhere?

No. Validation runs entirely in your browser through the native DOMParser — nothing is sent to a server, so a document holding a real msisdn or subscriber ID never leaves your machine.

What's the difference between well-formed and valid XML?

Well-formed means the document follows XML's structural rules: closed tags, quoted attributes, a single root. Valid (in the strict sense) means it also conforms to a schema like a DTD or XSD. This tool checks well-formedness, which is the first thing every XML parser requires. For schema-level checks, the W3C XML Schema specification is the reference.

What kinds of errors does it catch?

It catches every well-formedness problem: unclosed or mismatched tags, unquoted attributes, multiple root elements, illegal characters, and stray ampersands that should be written as &. If any of those are present, you get an error instead of a green check.

Can I validate large XML files?

Yes. The validator handles large documents efficiently because it runs on the browser's optimized parser. Very large files may take a moment, but everything stays local with no server-side limits.

Does it work on mobile devices?

Yes. The tool is fully responsive and works on phones and tablets, with the panels stacking vertically on small screens. If you get stuck on a tricky error, Stack Overflow's XML tag covers thousands of common cases.

Related Tools

Useful Resources