Skip to content

XML Validator

Check XML is well-formed and find the exact tag that breaks it.

Quick Tool Overview

The XML Validator checks a document is well-formed and, when it is not, names the line and the tag responsible. A document that passes is measured instead: elements, attributes, depth and text nodes.

What it does
Checks XML is well-formed and locates failures
You give it
Any XML document
You get back
A pass, or the line and the tag that broke it
Best for
Debugging feeds, API payloads and hand-edited configs
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the XML Validator

Well-formedness is the bar every XML document has to clear before anything else can read it: one root element, every tag closed, tags nested in the right order, attribute values quoted, and the five reserved characters escaped.

The validator checks all of that and, when something fails, names the line and the tag rather than reporting a generic parse error. A closing tag that does not match the open one, a tag that is never closed, a second root element, an unterminated comment or CDATA section — each gets its own message. A valid document is measured instead: element count, attribute count, nesting depth and the number of text nodes.

Key features of the XML Validator

The tag, not just the line

A mismatched closing tag names both the tag found and the one still open, which is the pair you need to see.

Catches the second root

Two elements at the top level is one of the commonest rejections, and it is reported as exactly that rather than as a parse error.

Unterminated sections found

A comment or CDATA block that is never closed is reported by line instead of swallowing the rest of the document silently.

Structure statistics

Element and attribute counts, nesting depth and text nodes confirm the document is the shape you expected.

Nothing is fetched

Well-formedness is checked entirely in your browser, with no schema URL fetched and no document uploaded.

How to use the XML Validator

  1. 1

    Paste the XML

    Any document you believe should parse — a feed, a config, an export.

  2. 2

    Read the verdict

    Green means well-formed. Red names the line and the tag that caused the failure.

  3. 3

    Fix and re-check

    The verdict updates as you type, so a fix is confirmed immediately.

  4. 4

    Check the structure

    Element and attribute counts and the nesting depth confirm the document is the shape you expected.

Frequently asked questions

Well-formed means the syntax is correct. Valid means it also conforms to a DTD or XSD schema. This tool checks well-formedness, which is the failure people actually hit.

Reviews of the XML Validator

What people who use the XML Validator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the XML Validator. It takes half a minute and no account.

Write the first review

More developer tools