WebTools

Format and validate XML

Indents the document and tells you if the markup does not close.

Indent an XML document and, while it is at it, check that it is well formed: an unclosed tag or an illegal character is reported before anything is touched.

Useful for RSS feeds, sitemaps, configuration files and any API response that arrives as XML on one unreadable line.

How to use it

  1. Paste the XML.
  2. Choose the indentation.
  3. Copy the result.

Frequently asked questions

What does “not valid” mean here?
That it is not well formed: an unclosed tag, a bare “&” that should be “&”, or two root elements. The message says what was expected.
Does it validate against a schema?
No. It checks the structure, not whether it satisfies an XSD or DTD, which is a much stricter check.
Are comments and CDATA sections kept?
Yes, they are in the result. What may change is the indentation of what is inside them.

Related tools