Skip to content
Devtools 360

Check if XML Is Well-Formed

Paste XML or open a file to find out immediately whether it parses. Errors are shown with the line, column and a pointer to the problem; valid documents get a structural summary including every declared namespace.

Runs in your browserFree · No sign-upBrowser limitations apply

How to validate XML

  1. Paste the XML on the Paste text tab, or upload an .xml, .svg, .rss or similar file.
  2. Read the result: a green well-formed confirmation, or a red error with its line and column and a snippet of the faulty line.
  3. For valid documents, review the root element, element and attribute counts, nesting depth and the namespace table.

Supported formats

Input
XML, SVG, RSS/Atom, XSD/XSL, XHTML
Maximum size
20 MB per file (limited by your device's memory)

Well-formed versus schema-valid

A well-formed document follows XML's syntax rules: one root element, every tag closed and correctly nested, attribute values quoted, and special characters like & escaped. A valid document additionally matches a DTD or XML Schema (XSD) that defines which elements may appear where. This tool checks the first, which catches the vast majority of broken feeds and config files. Once it passes, the XML Formatter can indent it for reading.

Benefits

  • Uses the browser's own standards-compliant XML parser, so results match how web apps will read the file.
  • Error messages from Chrome, Firefox and Safari are normalised into a consistent line-and-column format.
  • Namespace declarations, including the default namespace, are listed so prefix mix-ups are easy to spot.

Limitations

  • No DTD or XML Schema (XSD) validation — only well-formedness is checked, because browsers cannot validate against schemas.
  • External DTDs and entities are never downloaded, so documents relying on them may report undefined entities.
  • Error wording varies by browser, and some engines report only the first error in a document.

Privacy and security

Your XML is parsed by the browser's built-in DOMParser in this tab. It is not uploaded, nothing in it is executed or rendered, and no external resources it references are fetched.

Read our privacy policy for details about the site as a whole.

Frequently asked questions

Why does my XML fail with "EntityRef: expecting ';'" or "not well-formed"?

An ampersand (&) appears in text or an attribute without being escaped. Replace it with & or wrap the text in a CDATA section.

Can I validate against my XSD schema here?

No. Browsers have no XML Schema engine, so this tool checks syntax only. Use a desktop tool or a library such as xmllint or a schema-aware IDE for XSD validation.

Does an XML declaration have to be the first line?

Yes. If <?xml … ?> is present it must be at the very start of the file — even a blank line or space before it makes the document malformed.