curly{bits}

curlybits / XML Formatter / XML Validator

XML Validator

Paste XML to check it instantly. Well-formed XML gets a green tick with a count of its elements and depth. Errors show the exact line and column, with a plain-English explanation of what's wrong.

Input XML
Formatted XML

      

How to use the XML Validator

  1. Paste your XML in the left box.
  2. Read the result in the status bar: Valid XML, or the error with its line and column.
  3. Fix the problem and the check runs again as you type.
  4. The formatted XML on the right is ready to copy.

What makes XML invalid?

  • A tag that isn't closed, or tags closed in the wrong order: <b><i>text</b></i>.
  • More than one root element. An XML document needs exactly one outer tag.
  • A bare & or < in text. Write them as &amp; and &lt;.
  • Attribute values without quotes, or attributes without a value.
  • Tag names that differ only in case: <Item>…</item>. XML is case-sensitive.
  • Anything before the <?xml ?> declaration, even a blank line.

Well formed vs valid

This tool checks that XML is well formed: correct syntax that any XML parser can read. Checking it against a schema (XSD or DTD), to make sure it has the right elements in the right places, is a separate step this tool doesn't do.

Frequently asked questions

Is my XML uploaded?

No. It's checked by your browser's own XML parser.

Does it check against an XSD schema?

No, it checks that the XML is well formed. Schema validation isn't supported yet.

Can it check SVG, RSS and sitemap files?

Yes. They're all XML, so paste them in to check their syntax.

Updated