XML Formatter and Validator
Pretty-print or minify XML and check that it is well-formed, using the browser's own XML parser, with comments, CDATA and the declaration kept.
Free · No sign-up · Your inputs stay in your browser
Input
Format and validate XML
Output
Not well-formed
DOMParser is not defined
Checked with the browser's own XML parser, which reports the first error and its line. Well-formed is not the same as valid: validating against an XSD or DTD needs the schema, which this does not fetch.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Well-formed or valid
Well-formed XML follows the syntax rules of XML 1.0: one root element, every tag closed, attributes quoted, special characters escaped. Valid XML is also well-formed and matches a DTD or XSD that says which elements are allowed where. This tool checks the first; validating needs the schema.
The usual errors
An unescaped & in a URL (write &), a tag closed in the wrong order, and text before the XML declaration, which must be the very first thing in the file, account for most parse errors in sitemaps and feeds.